{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "c2b7da21-f761-4b32-9b9e-f8985e2f8dc9",
   "metadata": {},
   "source": [
    "Chapter 19\n",
    "# 聊聊Pandas\n",
    "Book_1《编程不难》 | 鸢尾花书：从加减乘除到机器学习  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a0096731-4e9c-4363-9a66-9fb1a7fae4c3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import seaborn as sns\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt \n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "f63a1833-49df-4f02-b4ff-8a7cdc02590b",
   "metadata": {},
   "outputs": [],
   "source": [
    "p = plt.rcParams\n",
    "p[\"font.sans-serif\"] = [\"Roboto\"]\n",
    "p[\"font.weight\"] = \"light\"\n",
    "p[\"ytick.minor.visible\"] = True\n",
    "p[\"xtick.minor.visible\"] = True\n",
    "p[\"axes.grid\"] = True\n",
    "p[\"grid.color\"] = \"0.5\"\n",
    "p[\"grid.linewidth\"] = 0.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "14ac1471-23c1-4f10-af2d-fb89b126430e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.4.4\n"
     ]
    }
   ],
   "source": [
    "print(pd.__version__)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "20a482ae-1991-4a1c-afb6-c322024f84aa",
   "metadata": {},
   "source": [
    "## 创建数据帧"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7e098b39-707b-4b0b-804b-ce366d72638f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 定义数据帧"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e0762d57-27d8-4c33-8ffc-8d1e7c7abe3f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "fea0eb07-5d5d-4349-bb84-0d37309ddef5",
   "metadata": {},
   "source": [
    "### 从字典"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "9d58acbc-2123-4fa8-a2a1-f1f5edd49a7d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Positive integer</th>\n",
       "      <th>Greek letter</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>alpha</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>beta</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>gamma</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>delta</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>epsilon</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Positive integer Greek letter\n",
       "0                 1        alpha\n",
       "1                 2         beta\n",
       "2                 3        gamma\n",
       "3                 4        delta\n",
       "4                 5      epsilon"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# dict_eg = {'first_column':  ['first_value', 'second_value', ...],\n",
    "#           'second_column':  ['first_value', 'second_value', ...],\n",
    "#           'third_column':   ['first_value', 'second_value', ...],\n",
    "#           ....}\n",
    "# 采用默认行索引，Zero-based numbering\n",
    "dict_eg = {'Positive integer': [1, 2, 3, 4, 5], \n",
    "           'Greek letter': ['alpha', 'beta', 'gamma', 'delta', 'epsilon']}\n",
    "df_from_dict = pd.DataFrame(data=dict_eg)\n",
    "df_from_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "b11f5b75-b4c4-4270-9e47-b6cf89e0b3b5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Greek letter</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Positive integer</th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>alpha</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>beta</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>gamma</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>delta</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>epsilon</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 Greek letter\n",
       "Positive integer             \n",
       "1                       alpha\n",
       "2                        beta\n",
       "3                       gamma\n",
       "4                       delta\n",
       "5                     epsilon"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_from_dict2 = df_from_dict.set_index('Positive integer')\n",
    "df_from_dict2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "cd3e9d5b-c0ec-4cb7-bb77-afb3f9119f94",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Positive integer</th>\n",
       "      <th>Greek letter</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>alpha</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>beta</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>gamma</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>delta</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>epsilon</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Positive integer Greek letter\n",
       "0                 1        alpha\n",
       "1                 2         beta\n",
       "2                 3        gamma\n",
       "3                 4        delta\n",
       "4                 5      epsilon"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_from_dict2.reset_index()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "3713ad5a-d5b5-4613-9be6-6b8c8a026f97",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Positive integer</th>\n",
       "      <th>Greek letter</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>1</td>\n",
       "      <td>alpha</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>2</td>\n",
       "      <td>beta</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>3</td>\n",
       "      <td>gamma</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>4</td>\n",
       "      <td>delta</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>e</th>\n",
       "      <td>5</td>\n",
       "      <td>epsilon</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Positive integer Greek letter\n",
       "a                 1        alpha\n",
       "b                 2         beta\n",
       "c                 3        gamma\n",
       "d                 4        delta\n",
       "e                 5      epsilon"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 修改行索引\n",
    "df_from_dict3 = pd.DataFrame(data=dict_eg, \n",
    "                             index = ['a', 'b', 'c', 'd', 'e'])\n",
    "df_from_dict3"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6728b940-6d2c-418d-b6a0-5453c4170463",
   "metadata": {},
   "source": [
    "### 从列表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "6650b37d-b8e5-4eaf-85f7-14fa422efc0d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>apple</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>banana</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>cherry</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>durian</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        0   1\n",
       "0   apple  11\n",
       "1  banana  22\n",
       "2  cherry  33\n",
       "3  durian  44"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list_fruits = [['apple',  11], \n",
    "               ['banana', 22], \n",
    "               ['cherry', 33],\n",
    "               ['durian', 44]]\n",
    "df_from_list1 = pd.DataFrame(list_fruits)\n",
    "df_from_list1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "b6b2eabe-d4ad-405e-a1f6-7d554a1292a1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>apple</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>banana</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>cherry</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>durian</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        0   1\n",
       "a   apple  11\n",
       "b  banana  22\n",
       "c  cherry  33\n",
       "d  durian  44"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 设定行索引\n",
    "df_from_list1.set_axis(['a', 'b', 'c', 'd'], axis='index')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "ab82ebdb-2f80-43cb-9fe7-2ed505cb5ee9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Fruit</th>\n",
       "      <th>Number</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>apple</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>banana</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>cherry</td>\n",
       "      <td>33</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>durian</td>\n",
       "      <td>44</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Fruit  Number\n",
       "0   apple      11\n",
       "1  banana      22\n",
       "2  cherry      33\n",
       "3  durian      44"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 设定行标签\n",
    "df_from_list1.set_axis(['Fruit', 'Number'], axis='columns')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a0ff15f6-3d8b-4f2b-840e-97f260bcae12",
   "metadata": {},
   "source": [
    "### 改变row index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "8a1ea9b0-a084-4626-97b2-5f70f00f2f13",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Fruit</th>\n",
       "      <th>Number</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>apple</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>banana</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>cherry</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>durian</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Fruit  Number\n",
       "a   apple       1\n",
       "b  banana       2\n",
       "c  cherry       3\n",
       "d  durian       4"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_from_list2 = pd.DataFrame(list_fruits, \n",
    "                            columns=['Fruit', 'Number'],\n",
    "                            index = ['a', 'b', 'c', 'd'])\n",
    "df_from_list2"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "26434935-cd3d-4cc9-870b-863cdeb32286",
   "metadata": {},
   "source": [
    "### 将numpy数组转化为数据帧"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "bc17ac9d-d9e0-4ed1-9579-ccc167f263a7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>X1</th>\n",
       "      <th>X2</th>\n",
       "      <th>X3</th>\n",
       "      <th>X4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.231867</td>\n",
       "      <td>1.117279</td>\n",
       "      <td>-0.056490</td>\n",
       "      <td>1.036729</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.155726</td>\n",
       "      <td>0.343871</td>\n",
       "      <td>-1.013261</td>\n",
       "      <td>0.326857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.970129</td>\n",
       "      <td>-0.751431</td>\n",
       "      <td>0.539380</td>\n",
       "      <td>-1.113460</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.122000</td>\n",
       "      <td>0.697247</td>\n",
       "      <td>-0.221885</td>\n",
       "      <td>-1.692631</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.516039</td>\n",
       "      <td>0.456265</td>\n",
       "      <td>1.625012</td>\n",
       "      <td>-0.924914</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.554518</td>\n",
       "      <td>-1.788675</td>\n",
       "      <td>1.358981</td>\n",
       "      <td>-0.084576</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>-0.113202</td>\n",
       "      <td>-1.114214</td>\n",
       "      <td>-0.274536</td>\n",
       "      <td>-0.610043</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.049631</td>\n",
       "      <td>0.441735</td>\n",
       "      <td>1.770006</td>\n",
       "      <td>0.199262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-0.663785</td>\n",
       "      <td>0.662908</td>\n",
       "      <td>0.823971</td>\n",
       "      <td>-0.734798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.501641</td>\n",
       "      <td>1.876047</td>\n",
       "      <td>-0.491224</td>\n",
       "      <td>1.510807</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         X1        X2        X3        X4\n",
       "0  1.231867  1.117279 -0.056490  1.036729\n",
       "1 -0.155726  0.343871 -1.013261  0.326857\n",
       "2 -0.970129 -0.751431  0.539380 -1.113460\n",
       "3  0.122000  0.697247 -0.221885 -1.692631\n",
       "4  0.516039  0.456265  1.625012 -0.924914\n",
       "5  0.554518 -1.788675  1.358981 -0.084576\n",
       "6 -0.113202 -1.114214 -0.274536 -0.610043\n",
       "7  0.049631  0.441735  1.770006  0.199262\n",
       "8 -0.663785  0.662908  0.823971 -0.734798\n",
       "9  0.501641  1.876047 -0.491224  1.510807"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "numpy_array = np.random.normal(size = (10,4))\n",
    "# NumPy库中的random.normal函数生成一个形状为(10, 4)的二维数组（矩阵），其中的元素是从正态分布（高斯分布）中随机抽取的数据。\n",
    "df_from_np = pd.DataFrame(numpy_array,\n",
    "                   columns=['X1', 'X2', 'X3', 'X4'])\n",
    "df_from_np"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7816b607-1ba3-4df1-a676-006cab2cf348",
   "metadata": {},
   "source": [
    "### for循环生成数据帧"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "4a7db695-aefc-4991-8b63-82134aeda0ea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>X1</th>\n",
       "      <th>X2</th>\n",
       "      <th>X3</th>\n",
       "      <th>X4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.312332</td>\n",
       "      <td>-0.668647</td>\n",
       "      <td>0.210887</td>\n",
       "      <td>1.528462</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.173934</td>\n",
       "      <td>-0.718208</td>\n",
       "      <td>-0.104195</td>\n",
       "      <td>-0.124045</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.370471</td>\n",
       "      <td>-0.519110</td>\n",
       "      <td>-0.284365</td>\n",
       "      <td>-0.106439</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1.381143</td>\n",
       "      <td>-0.035670</td>\n",
       "      <td>1.104991</td>\n",
       "      <td>-1.341760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.451731</td>\n",
       "      <td>0.135241</td>\n",
       "      <td>-0.800139</td>\n",
       "      <td>1.191539</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>-1.827362</td>\n",
       "      <td>0.025270</td>\n",
       "      <td>0.676894</td>\n",
       "      <td>-1.134964</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.414238</td>\n",
       "      <td>-0.800643</td>\n",
       "      <td>0.868747</td>\n",
       "      <td>0.852296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.965530</td>\n",
       "      <td>0.975173</td>\n",
       "      <td>1.415879</td>\n",
       "      <td>0.791151</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-1.716721</td>\n",
       "      <td>1.211521</td>\n",
       "      <td>0.176921</td>\n",
       "      <td>-0.067602</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.456790</td>\n",
       "      <td>-1.434534</td>\n",
       "      <td>-0.577991</td>\n",
       "      <td>-0.944067</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         X1        X2        X3        X4\n",
       "0  0.312332 -0.668647  0.210887  1.528462\n",
       "1  0.173934 -0.718208 -0.104195 -0.124045\n",
       "2 -0.370471 -0.519110 -0.284365 -0.106439\n",
       "3  1.381143 -0.035670  1.104991 -1.341760\n",
       "4  0.451731  0.135241 -0.800139  1.191539\n",
       "5 -1.827362  0.025270  0.676894 -1.134964\n",
       "6  0.414238 -0.800643  0.868747  0.852296\n",
       "7  0.965530  0.975173  1.415879  0.791151\n",
       "8 -1.716721  1.211521  0.176921 -0.067602\n",
       "9  0.456790 -1.434534 -0.577991 -0.944067"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np_data = []\n",
    "# 创建一个空list\n",
    "for idx in range(10):\n",
    "    data_idx = np.random.normal(size = (1,4)).tolist()\n",
    "    np_data.append(data_idx[0])\n",
    "\n",
    "# 注意，用list.append() 速度相对较快\n",
    "df_for_loop = pd.DataFrame(np_data,\n",
    "                           columns = ['X1','X2','X3','X4'])\n",
    "df_for_loop"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "97ccb400-d994-4e33-add8-90a1d0d73699",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.4567896816131635,\n",
       " -1.4345343632134395,\n",
       " -0.577991192985323,\n",
       " -0.9440672908051952]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_idx[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb1204b2-1f67-47e5-8b6b-890e797d193d",
   "metadata": {},
   "source": [
    "## 鸢尾花数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "6026c5de-35b1-46f4-bb52-6b8a36226bcb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     sepal_length  sepal_width  petal_length  petal_width    species\n",
       "0             5.1          3.5           1.4          0.2     setosa\n",
       "1             4.9          3.0           1.4          0.2     setosa\n",
       "2             4.7          3.2           1.3          0.2     setosa\n",
       "3             4.6          3.1           1.5          0.2     setosa\n",
       "4             5.0          3.6           1.4          0.2     setosa\n",
       "..            ...          ...           ...          ...        ...\n",
       "145           6.7          3.0           5.2          2.3  virginica\n",
       "146           6.3          2.5           5.0          1.9  virginica\n",
       "147           6.5          3.0           5.2          2.0  virginica\n",
       "148           6.2          3.4           5.4          2.3  virginica\n",
       "149           5.9          3.0           5.1          1.8  virginica\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df = sns.load_dataset(\"iris\")\n",
    "# 从Seaborn中导入鸢尾花数据帧\n",
    "iris_df.to_csv('iris_df.csv')\n",
    "iris_df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "0a54cc3f-23d5-43c5-bb05-1c0186cbadef",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAe8AAAKZCAYAAACRGqOMAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAA9hAAAPYQGoP6dpAABxr0lEQVR4nO3de3QUZbo/+m8n6e4kBJJACEKUqBECiYCAykUCJCKoEVBBbkYDIkYTHUZm9qyd85vfRs6Z38k+2711OxgBRQwKyMVxkMtmFDCAYriaAEOIRoNRopIQoKFz6WudPxh6uujudHdSXdXd9f2sVWvZb1e99XQLPF1V7/s+GkEQBBAREVHIiFA6ACIiIvIPkzcREVGIYfImIiIKMUzeREREIYbJm4iIKMQweRMREYUYJm8iIqIQw+RNREQUYpi8iYiIQkyU0gEQERGpUX19PT7++GN0794dZrMZ8fHxePLJJ306ViPn8qgWiwVvv/02dDod7HY7+vfvj4ceekiu0xMREQWNN954A4sXL3a8PnToENrb2zFx4kSvx8p65b1582bMnz8f3bp1AwDs2LEDP//8M/r16ydnGERERIpqaWlBamqqqG306NH44IMPfDpe1mfeFovFkbg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9vZ2DBs2DPfccw8A4OjRo/j666+h1+vR0tKChQsXIjo6Wpov14tg+O7feecdPP3004653l988QXq6uqQn5/v2Ke0tBRFRUWiP9s3ftfXFwkBEJTfNbnRiXXXQ8K7774rel1aWirYbDbhjTfeEGw2m6N98+bNwvnz5wVBEIQnn3xSuHLliuO9w4cPC8eOHRMEQRDWr18vXL161fFea2ursGnTJsdrb4vJl5eXCz/99JMgCILwySefCN9//73jvfPnzwubN28WBEEQ1qxZI4rdbrcLZWVlos/hbMOGDcKGDRs8xvHEE08IDQ0Njtcff/yxcPny5Q5j7apg++6XL18uev3GG28IH330keP122+/LZjNZpe+bvyut2zZIrz//vsez6vEd+3pe/vqq6+EiooKR3tra6uwZs0ax2vn2BsaGoTt27eL+nX+M+dLoYTr+1y6dEl47733RO9d/x7Pnj0rFBQUiP5fOu+7detW4dy5c47X9fX1QlFRkcc43njjDcffG0EQBKPRKHodaMHw3f/9738XPv/8c8frtWvXCu+8847j9YULFxx/V5z7uvG7PnfunPDCCy94PK/S3zW5Ctvb5jeuD5uXl4e///3vGDt2LCIi/vmxH3vsMXzxxRcAgJycHNEv0HvvvRfV1dUAgEcffVRUOD0mJgZWq7VTsV2+fBm3336743VycrKjhmtjYyNmzpzpeE+j0UCr1QIAmpqakJqaKurrscceg81m83iuAQMGoF+/fo7XmZmZqK2t7VTcvgq2737AgAGOz1xZWYnx48ejqalJFO/17/g6d9/19OnTvZ5H7u/a0/dWW1uL0aNHO9pjYmIQGxvrto+kpCQ89NBDorYbvw9f/c///I/j6vO64cOH48cffwQAjBw5UvT/sl+/frhw4QIA4NKlS0hJSXG8179/f9x1110ez9XU1CT6u9KtWzef14WWQjB895mZmY6/JwBgs9mg1WrR1tYGACgvL0d2drbLcTd+1ykpKbj77rs9nkfp75pche1t8xEjRmDNmjW4+eabkZWVhR49euCbb77B1atX8fe//120b3JyMgC4vQ0bGRkJAIiNjcWXX36JM2fOIDIyEhEREaIE4I8jR464FFy/vkB9SkqKyzrF1/etr68XJ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1FRUY6pH9enVowbNw5//vOf0b17d1itVmRkZLg8v/PV1KlT8dFHH+HQoUPQ6XRob2/3eUrRgw8+iP/4j/9Ajx49YLfbMWzYMFFBd61Wi7fffhuTJk3y+Ks7kIL1u7/77ruxZs0a0cChm266yfHjwZ2HH34Yr776Knr06AGNRoMhQ4aIbqUr/V0DHX9vn332GVatWoXo6GiYTCZMnDjRbeyPPvooli9fjoSEBAiCgIiICBQVFaGpqUk0AM8X8fHxyMnJQWlpKbp16wa73Y5bb70VAwcO9Hrsww8/jFWrVsFqtUKr1UKr1YruuIwePRqvvfYaMjIy8OCDD/oVVyAE03ff0NCAGTNmOF6PHDkSq1evFiV0Z7m5uVi5cqVjqphWq8WoUaNEny2YvmtyxZKgTpznQXbGL7/8gp07d7q033333R2Omu2K8+fPo6amRnRFGYpC8bsPBl393vyxadMml7sg8fHxeOKJJwJ6ztmzZwes/64I9++egltYXnkrpW/fvnj22WcDeo7Dhw+LfiEfOHAAubm5AT1nKJDju1e7QCfRmpoa9O3b17Hgzc8//4zExMSAnjNUBOsPGFIOk3eISUhIwJ///Gd069YNNpsNI0aM8DiHlCiU3HHHHXj77beh1WoRFRWFqKioTs3KIFID3jYnIiIKMWE52pyIiCicMXkTERGFGCZvIiKiEMPkTUREFGKYvImIiEIMkzcREVGIYfImIiIKMUzeREREIYbJm4iIKMT8/4A5H4a1XMoqAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 600x800 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig,ax = plt.subplots(figsize = (6,8))\n",
    "sns.heatmap(iris_df.iloc[:, 0:4], \n",
    "            cmap = 'RdYlBu_r',\n",
    "            ax = ax,\n",
    "            vmax = 0, vmin = 8,\n",
    "            cbar_kws = {'orientation':'vertical'},\n",
    "            annot=False)\n",
    "\n",
    "fig.savefig('鸢尾花数据dataframe.svg', format='svg')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "10b7082a-a8f5-4caa-8207-c7937328ddec",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "     sepal_length  sepal_width  petal_length  petal_width     species\n",
      "0             5.1          3.5           1.4          0.2      setosa\n",
      "1             4.9          3.0           1.4          0.2      setosa\n",
      "2             4.7          3.2           1.3          0.2      setosa\n",
      "3             4.6          3.1           1.5          0.2      setosa\n",
      "4             5.0          3.6           1.4          0.2      setosa\n",
      "5             5.4          3.9           1.7          0.4      setosa\n",
      "6             4.6          3.4           1.4          0.3      setosa\n",
      "7             5.0          3.4           1.5          0.2      setosa\n",
      "8             4.4          2.9           1.4          0.2      setosa\n",
      "9             4.9          3.1           1.5          0.1      setosa\n",
      "10            5.4          3.7           1.5          0.2      setosa\n",
      "11            4.8          3.4           1.6          0.2      setosa\n",
      "12            4.8          3.0           1.4          0.1      setosa\n",
      "13            4.3          3.0           1.1          0.1      setosa\n",
      "14            5.8          4.0           1.2          0.2      setosa\n",
      "15            5.7          4.4           1.5          0.4      setosa\n",
      "16            5.4          3.9           1.3          0.4      setosa\n",
      "17            5.1          3.5           1.4          0.3      setosa\n",
      "18            5.7          3.8           1.7          0.3      setosa\n",
      "19            5.1          3.8           1.5          0.3      setosa\n",
      "20            5.4          3.4           1.7          0.2      setosa\n",
      "21            5.1          3.7           1.5          0.4      setosa\n",
      "22            4.6          3.6           1.0          0.2      setosa\n",
      "23            5.1          3.3           1.7          0.5      setosa\n",
      "24            4.8          3.4           1.9          0.2      setosa\n",
      "25            5.0          3.0           1.6          0.2      setosa\n",
      "26            5.0          3.4           1.6          0.4      setosa\n",
      "27            5.2          3.5           1.5          0.2      setosa\n",
      "28            5.2          3.4           1.4          0.2      setosa\n",
      "29            4.7          3.2           1.6          0.2      setosa\n",
      "30            4.8          3.1           1.6          0.2      setosa\n",
      "31            5.4          3.4           1.5          0.4      setosa\n",
      "32            5.2          4.1           1.5          0.1      setosa\n",
      "33            5.5          4.2           1.4          0.2      setosa\n",
      "34            4.9          3.1           1.5          0.2      setosa\n",
      "35            5.0          3.2           1.2          0.2      setosa\n",
      "36            5.5          3.5           1.3          0.2      setosa\n",
      "37            4.9          3.6           1.4          0.1      setosa\n",
      "38            4.4          3.0           1.3          0.2      setosa\n",
      "39            5.1          3.4           1.5          0.2      setosa\n",
      "40            5.0          3.5           1.3          0.3      setosa\n",
      "41            4.5          2.3           1.3          0.3      setosa\n",
      "42            4.4          3.2           1.3          0.2      setosa\n",
      "43            5.0          3.5           1.6          0.6      setosa\n",
      "44            5.1          3.8           1.9          0.4      setosa\n",
      "45            4.8          3.0           1.4          0.3      setosa\n",
      "46            5.1          3.8           1.6          0.2      setosa\n",
      "47            4.6          3.2           1.4          0.2      setosa\n",
      "48            5.3          3.7           1.5          0.2      setosa\n",
      "49            5.0          3.3           1.4          0.2      setosa\n",
      "50            7.0          3.2           4.7          1.4  versicolor\n",
      "51            6.4          3.2           4.5          1.5  versicolor\n",
      "52            6.9          3.1           4.9          1.5  versicolor\n",
      "53            5.5          2.3           4.0          1.3  versicolor\n",
      "54            6.5          2.8           4.6          1.5  versicolor\n",
      "55            5.7          2.8           4.5          1.3  versicolor\n",
      "56            6.3          3.3           4.7          1.6  versicolor\n",
      "57            4.9          2.4           3.3          1.0  versicolor\n",
      "58            6.6          2.9           4.6          1.3  versicolor\n",
      "59            5.2          2.7           3.9          1.4  versicolor\n",
      "60            5.0          2.0           3.5          1.0  versicolor\n",
      "61            5.9          3.0           4.2          1.5  versicolor\n",
      "62            6.0          2.2           4.0          1.0  versicolor\n",
      "63            6.1          2.9           4.7          1.4  versicolor\n",
      "64            5.6          2.9           3.6          1.3  versicolor\n",
      "65            6.7          3.1           4.4          1.4  versicolor\n",
      "66            5.6          3.0           4.5          1.5  versicolor\n",
      "67            5.8          2.7           4.1          1.0  versicolor\n",
      "68            6.2          2.2           4.5          1.5  versicolor\n",
      "69            5.6          2.5           3.9          1.1  versicolor\n",
      "70            5.9          3.2           4.8          1.8  versicolor\n",
      "71            6.1          2.8           4.0          1.3  versicolor\n",
      "72            6.3          2.5           4.9          1.5  versicolor\n",
      "73            6.1          2.8           4.7          1.2  versicolor\n",
      "74            6.4          2.9           4.3          1.3  versicolor\n",
      "75            6.6          3.0           4.4          1.4  versicolor\n",
      "76            6.8          2.8           4.8          1.4  versicolor\n",
      "77            6.7          3.0           5.0          1.7  versicolor\n",
      "78            6.0          2.9           4.5          1.5  versicolor\n",
      "79            5.7          2.6           3.5          1.0  versicolor\n",
      "80            5.5          2.4           3.8          1.1  versicolor\n",
      "81            5.5          2.4           3.7          1.0  versicolor\n",
      "82            5.8          2.7           3.9          1.2  versicolor\n",
      "83            6.0          2.7           5.1          1.6  versicolor\n",
      "84            5.4          3.0           4.5          1.5  versicolor\n",
      "85            6.0          3.4           4.5          1.6  versicolor\n",
      "86            6.7          3.1           4.7          1.5  versicolor\n",
      "87            6.3          2.3           4.4          1.3  versicolor\n",
      "88            5.6          3.0           4.1          1.3  versicolor\n",
      "89            5.5          2.5           4.0          1.3  versicolor\n",
      "90            5.5          2.6           4.4          1.2  versicolor\n",
      "91            6.1          3.0           4.6          1.4  versicolor\n",
      "92            5.8          2.6           4.0          1.2  versicolor\n",
      "93            5.0          2.3           3.3          1.0  versicolor\n",
      "94            5.6          2.7           4.2          1.3  versicolor\n",
      "95            5.7          3.0           4.2          1.2  versicolor\n",
      "96            5.7          2.9           4.2          1.3  versicolor\n",
      "97            6.2          2.9           4.3          1.3  versicolor\n",
      "98            5.1          2.5           3.0          1.1  versicolor\n",
      "99            5.7          2.8           4.1          1.3  versicolor\n",
      "100           6.3          3.3           6.0          2.5   virginica\n",
      "101           5.8          2.7           5.1          1.9   virginica\n",
      "102           7.1          3.0           5.9          2.1   virginica\n",
      "103           6.3          2.9           5.6          1.8   virginica\n",
      "104           6.5          3.0           5.8          2.2   virginica\n",
      "105           7.6          3.0           6.6          2.1   virginica\n",
      "106           4.9          2.5           4.5          1.7   virginica\n",
      "107           7.3          2.9           6.3          1.8   virginica\n",
      "108           6.7          2.5           5.8          1.8   virginica\n",
      "109           7.2          3.6           6.1          2.5   virginica\n",
      "110           6.5          3.2           5.1          2.0   virginica\n",
      "111           6.4          2.7           5.3          1.9   virginica\n",
      "112           6.8          3.0           5.5          2.1   virginica\n",
      "113           5.7          2.5           5.0          2.0   virginica\n",
      "114           5.8          2.8           5.1          2.4   virginica\n",
      "115           6.4          3.2           5.3          2.3   virginica\n",
      "116           6.5          3.0           5.5          1.8   virginica\n",
      "117           7.7          3.8           6.7          2.2   virginica\n",
      "118           7.7          2.6           6.9          2.3   virginica\n",
      "119           6.0          2.2           5.0          1.5   virginica\n",
      "120           6.9          3.2           5.7          2.3   virginica\n",
      "121           5.6          2.8           4.9          2.0   virginica\n",
      "122           7.7          2.8           6.7          2.0   virginica\n",
      "123           6.3          2.7           4.9          1.8   virginica\n",
      "124           6.7          3.3           5.7          2.1   virginica\n",
      "125           7.2          3.2           6.0          1.8   virginica\n",
      "126           6.2          2.8           4.8          1.8   virginica\n",
      "127           6.1          3.0           4.9          1.8   virginica\n",
      "128           6.4          2.8           5.6          2.1   virginica\n",
      "129           7.2          3.0           5.8          1.6   virginica\n",
      "130           7.4          2.8           6.1          1.9   virginica\n",
      "131           7.9          3.8           6.4          2.0   virginica\n",
      "132           6.4          2.8           5.6          2.2   virginica\n",
      "133           6.3          2.8           5.1          1.5   virginica\n",
      "134           6.1          2.6           5.6          1.4   virginica\n",
      "135           7.7          3.0           6.1          2.3   virginica\n",
      "136           6.3          3.4           5.6          2.4   virginica\n",
      "137           6.4          3.1           5.5          1.8   virginica\n",
      "138           6.0          3.0           4.8          1.8   virginica\n",
      "139           6.9          3.1           5.4          2.1   virginica\n",
      "140           6.7          3.1           5.6          2.4   virginica\n",
      "141           6.9          3.1           5.1          2.3   virginica\n",
      "142           5.8          2.7           5.1          1.9   virginica\n",
      "143           6.8          3.2           5.9          2.3   virginica\n",
      "144           6.7          3.3           5.7          2.5   virginica\n",
      "145           6.7          3.0           5.2          2.3   virginica\n",
      "146           6.3          2.5           5.0          1.9   virginica\n",
      "147           6.5          3.0           5.2          2.0   virginica\n",
      "148           6.2          3.4           5.4          2.3   virginica\n",
      "149           5.9          3.0           5.1          1.8   virginica\n"
     ]
    }
   ],
   "source": [
    "# 打印整个数据集\n",
    "print(iris_df.to_string())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "60c233c8-0cf3-45ae-a291-4f7f225a3a6b",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.1, 3.5, 1.4, 0.2, 'setosa'],\n",
       "       [4.9, 3.0, 1.4, 0.2, 'setosa'],\n",
       "       [4.7, 3.2, 1.3, 0.2, 'setosa'],\n",
       "       [4.6, 3.1, 1.5, 0.2, 'setosa'],\n",
       "       [5.0, 3.6, 1.4, 0.2, 'setosa'],\n",
       "       [5.4, 3.9, 1.7, 0.4, 'setosa'],\n",
       "       [4.6, 3.4, 1.4, 0.3, 'setosa'],\n",
       "       [5.0, 3.4, 1.5, 0.2, 'setosa'],\n",
       "       [4.4, 2.9, 1.4, 0.2, 'setosa'],\n",
       "       [4.9, 3.1, 1.5, 0.1, 'setosa'],\n",
       "       [5.4, 3.7, 1.5, 0.2, 'setosa'],\n",
       "       [4.8, 3.4, 1.6, 0.2, 'setosa'],\n",
       "       [4.8, 3.0, 1.4, 0.1, 'setosa'],\n",
       "       [4.3, 3.0, 1.1, 0.1, 'setosa'],\n",
       "       [5.8, 4.0, 1.2, 0.2, 'setosa'],\n",
       "       [5.7, 4.4, 1.5, 0.4, 'setosa'],\n",
       "       [5.4, 3.9, 1.3, 0.4, 'setosa'],\n",
       "       [5.1, 3.5, 1.4, 0.3, 'setosa'],\n",
       "       [5.7, 3.8, 1.7, 0.3, 'setosa'],\n",
       "       [5.1, 3.8, 1.5, 0.3, 'setosa'],\n",
       "       [5.4, 3.4, 1.7, 0.2, 'setosa'],\n",
       "       [5.1, 3.7, 1.5, 0.4, 'setosa'],\n",
       "       [4.6, 3.6, 1.0, 0.2, 'setosa'],\n",
       "       [5.1, 3.3, 1.7, 0.5, 'setosa'],\n",
       "       [4.8, 3.4, 1.9, 0.2, 'setosa'],\n",
       "       [5.0, 3.0, 1.6, 0.2, 'setosa'],\n",
       "       [5.0, 3.4, 1.6, 0.4, 'setosa'],\n",
       "       [5.2, 3.5, 1.5, 0.2, 'setosa'],\n",
       "       [5.2, 3.4, 1.4, 0.2, 'setosa'],\n",
       "       [4.7, 3.2, 1.6, 0.2, 'setosa'],\n",
       "       [4.8, 3.1, 1.6, 0.2, 'setosa'],\n",
       "       [5.4, 3.4, 1.5, 0.4, 'setosa'],\n",
       "       [5.2, 4.1, 1.5, 0.1, 'setosa'],\n",
       "       [5.5, 4.2, 1.4, 0.2, 'setosa'],\n",
       "       [4.9, 3.1, 1.5, 0.2, 'setosa'],\n",
       "       [5.0, 3.2, 1.2, 0.2, 'setosa'],\n",
       "       [5.5, 3.5, 1.3, 0.2, 'setosa'],\n",
       "       [4.9, 3.6, 1.4, 0.1, 'setosa'],\n",
       "       [4.4, 3.0, 1.3, 0.2, 'setosa'],\n",
       "       [5.1, 3.4, 1.5, 0.2, 'setosa'],\n",
       "       [5.0, 3.5, 1.3, 0.3, 'setosa'],\n",
       "       [4.5, 2.3, 1.3, 0.3, 'setosa'],\n",
       "       [4.4, 3.2, 1.3, 0.2, 'setosa'],\n",
       "       [5.0, 3.5, 1.6, 0.6, 'setosa'],\n",
       "       [5.1, 3.8, 1.9, 0.4, 'setosa'],\n",
       "       [4.8, 3.0, 1.4, 0.3, 'setosa'],\n",
       "       [5.1, 3.8, 1.6, 0.2, 'setosa'],\n",
       "       [4.6, 3.2, 1.4, 0.2, 'setosa'],\n",
       "       [5.3, 3.7, 1.5, 0.2, 'setosa'],\n",
       "       [5.0, 3.3, 1.4, 0.2, 'setosa'],\n",
       "       [7.0, 3.2, 4.7, 1.4, 'versicolor'],\n",
       "       [6.4, 3.2, 4.5, 1.5, 'versicolor'],\n",
       "       [6.9, 3.1, 4.9, 1.5, 'versicolor'],\n",
       "       [5.5, 2.3, 4.0, 1.3, 'versicolor'],\n",
       "       [6.5, 2.8, 4.6, 1.5, 'versicolor'],\n",
       "       [5.7, 2.8, 4.5, 1.3, 'versicolor'],\n",
       "       [6.3, 3.3, 4.7, 1.6, 'versicolor'],\n",
       "       [4.9, 2.4, 3.3, 1.0, 'versicolor'],\n",
       "       [6.6, 2.9, 4.6, 1.3, 'versicolor'],\n",
       "       [5.2, 2.7, 3.9, 1.4, 'versicolor'],\n",
       "       [5.0, 2.0, 3.5, 1.0, 'versicolor'],\n",
       "       [5.9, 3.0, 4.2, 1.5, 'versicolor'],\n",
       "       [6.0, 2.2, 4.0, 1.0, 'versicolor'],\n",
       "       [6.1, 2.9, 4.7, 1.4, 'versicolor'],\n",
       "       [5.6, 2.9, 3.6, 1.3, 'versicolor'],\n",
       "       [6.7, 3.1, 4.4, 1.4, 'versicolor'],\n",
       "       [5.6, 3.0, 4.5, 1.5, 'versicolor'],\n",
       "       [5.8, 2.7, 4.1, 1.0, 'versicolor'],\n",
       "       [6.2, 2.2, 4.5, 1.5, 'versicolor'],\n",
       "       [5.6, 2.5, 3.9, 1.1, 'versicolor'],\n",
       "       [5.9, 3.2, 4.8, 1.8, 'versicolor'],\n",
       "       [6.1, 2.8, 4.0, 1.3, 'versicolor'],\n",
       "       [6.3, 2.5, 4.9, 1.5, 'versicolor'],\n",
       "       [6.1, 2.8, 4.7, 1.2, 'versicolor'],\n",
       "       [6.4, 2.9, 4.3, 1.3, 'versicolor'],\n",
       "       [6.6, 3.0, 4.4, 1.4, 'versicolor'],\n",
       "       [6.8, 2.8, 4.8, 1.4, 'versicolor'],\n",
       "       [6.7, 3.0, 5.0, 1.7, 'versicolor'],\n",
       "       [6.0, 2.9, 4.5, 1.5, 'versicolor'],\n",
       "       [5.7, 2.6, 3.5, 1.0, 'versicolor'],\n",
       "       [5.5, 2.4, 3.8, 1.1, 'versicolor'],\n",
       "       [5.5, 2.4, 3.7, 1.0, 'versicolor'],\n",
       "       [5.8, 2.7, 3.9, 1.2, 'versicolor'],\n",
       "       [6.0, 2.7, 5.1, 1.6, 'versicolor'],\n",
       "       [5.4, 3.0, 4.5, 1.5, 'versicolor'],\n",
       "       [6.0, 3.4, 4.5, 1.6, 'versicolor'],\n",
       "       [6.7, 3.1, 4.7, 1.5, 'versicolor'],\n",
       "       [6.3, 2.3, 4.4, 1.3, 'versicolor'],\n",
       "       [5.6, 3.0, 4.1, 1.3, 'versicolor'],\n",
       "       [5.5, 2.5, 4.0, 1.3, 'versicolor'],\n",
       "       [5.5, 2.6, 4.4, 1.2, 'versicolor'],\n",
       "       [6.1, 3.0, 4.6, 1.4, 'versicolor'],\n",
       "       [5.8, 2.6, 4.0, 1.2, 'versicolor'],\n",
       "       [5.0, 2.3, 3.3, 1.0, 'versicolor'],\n",
       "       [5.6, 2.7, 4.2, 1.3, 'versicolor'],\n",
       "       [5.7, 3.0, 4.2, 1.2, 'versicolor'],\n",
       "       [5.7, 2.9, 4.2, 1.3, 'versicolor'],\n",
       "       [6.2, 2.9, 4.3, 1.3, 'versicolor'],\n",
       "       [5.1, 2.5, 3.0, 1.1, 'versicolor'],\n",
       "       [5.7, 2.8, 4.1, 1.3, 'versicolor'],\n",
       "       [6.3, 3.3, 6.0, 2.5, 'virginica'],\n",
       "       [5.8, 2.7, 5.1, 1.9, 'virginica'],\n",
       "       [7.1, 3.0, 5.9, 2.1, 'virginica'],\n",
       "       [6.3, 2.9, 5.6, 1.8, 'virginica'],\n",
       "       [6.5, 3.0, 5.8, 2.2, 'virginica'],\n",
       "       [7.6, 3.0, 6.6, 2.1, 'virginica'],\n",
       "       [4.9, 2.5, 4.5, 1.7, 'virginica'],\n",
       "       [7.3, 2.9, 6.3, 1.8, 'virginica'],\n",
       "       [6.7, 2.5, 5.8, 1.8, 'virginica'],\n",
       "       [7.2, 3.6, 6.1, 2.5, 'virginica'],\n",
       "       [6.5, 3.2, 5.1, 2.0, 'virginica'],\n",
       "       [6.4, 2.7, 5.3, 1.9, 'virginica'],\n",
       "       [6.8, 3.0, 5.5, 2.1, 'virginica'],\n",
       "       [5.7, 2.5, 5.0, 2.0, 'virginica'],\n",
       "       [5.8, 2.8, 5.1, 2.4, 'virginica'],\n",
       "       [6.4, 3.2, 5.3, 2.3, 'virginica'],\n",
       "       [6.5, 3.0, 5.5, 1.8, 'virginica'],\n",
       "       [7.7, 3.8, 6.7, 2.2, 'virginica'],\n",
       "       [7.7, 2.6, 6.9, 2.3, 'virginica'],\n",
       "       [6.0, 2.2, 5.0, 1.5, 'virginica'],\n",
       "       [6.9, 3.2, 5.7, 2.3, 'virginica'],\n",
       "       [5.6, 2.8, 4.9, 2.0, 'virginica'],\n",
       "       [7.7, 2.8, 6.7, 2.0, 'virginica'],\n",
       "       [6.3, 2.7, 4.9, 1.8, 'virginica'],\n",
       "       [6.7, 3.3, 5.7, 2.1, 'virginica'],\n",
       "       [7.2, 3.2, 6.0, 1.8, 'virginica'],\n",
       "       [6.2, 2.8, 4.8, 1.8, 'virginica'],\n",
       "       [6.1, 3.0, 4.9, 1.8, 'virginica'],\n",
       "       [6.4, 2.8, 5.6, 2.1, 'virginica'],\n",
       "       [7.2, 3.0, 5.8, 1.6, 'virginica'],\n",
       "       [7.4, 2.8, 6.1, 1.9, 'virginica'],\n",
       "       [7.9, 3.8, 6.4, 2.0, 'virginica'],\n",
       "       [6.4, 2.8, 5.6, 2.2, 'virginica'],\n",
       "       [6.3, 2.8, 5.1, 1.5, 'virginica'],\n",
       "       [6.1, 2.6, 5.6, 1.4, 'virginica'],\n",
       "       [7.7, 3.0, 6.1, 2.3, 'virginica'],\n",
       "       [6.3, 3.4, 5.6, 2.4, 'virginica'],\n",
       "       [6.4, 3.1, 5.5, 1.8, 'virginica'],\n",
       "       [6.0, 3.0, 4.8, 1.8, 'virginica'],\n",
       "       [6.9, 3.1, 5.4, 2.1, 'virginica'],\n",
       "       [6.7, 3.1, 5.6, 2.4, 'virginica'],\n",
       "       [6.9, 3.1, 5.1, 2.3, 'virginica'],\n",
       "       [5.8, 2.7, 5.1, 1.9, 'virginica'],\n",
       "       [6.8, 3.2, 5.9, 2.3, 'virginica'],\n",
       "       [6.7, 3.3, 5.7, 2.5, 'virginica'],\n",
       "       [6.7, 3.0, 5.2, 2.3, 'virginica'],\n",
       "       [6.3, 2.5, 5.0, 1.9, 'virginica'],\n",
       "       [6.5, 3.0, 5.2, 2.0, 'virginica'],\n",
       "       [6.2, 3.4, 5.4, 2.3, 'virginica'],\n",
       "       [5.9, 3.0, 5.1, 1.8, 'virginica']], dtype=object)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.to_numpy() # 将数据帧转化为NumPy array\n",
    "# , dtype=object\n",
    "# 在 NumPy 中，dtype=object 表示数组中的元素类型为 Python 对象。\n",
    "# 这意味着数组的每个元素都可以是任意类型的 Python 对象，\n",
    "# 例如整数、浮点数、字符串、列表、字典等。\n",
    "# 与其他 NumPy 数组不同，dtype=object 数组允许每个元素具有不同的数据类型。\n",
    "\n",
    "# 当你创建一个 NumPy 数组并指定 dtype=object，\n",
    "# NumPy 将会把数组视为一个包含 Python 对象的数组，\n",
    "# 而不是传统的数值类型数组。这种数组的灵活性较高，\n",
    "# 但也会导致一些性能上的损失，\n",
    "# 因为在处理数组时无法利用 NumPy 的优化和并行计算功能。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0444a374-3a5e-4d79-9d25-fbce9c97c20f",
   "metadata": {},
   "source": [
    "## 查询"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "df940e93-bdd2-4125-9bee-92db99a57a17",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "RangeIndex(start=0, stop=150, step=1)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pandas.DataFrame.index\n",
    "iris_df.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "64795a18-d033-4838-a557-3152aa61e683",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0,\n",
       " 1,\n",
       " 2,\n",
       " 3,\n",
       " 4,\n",
       " 5,\n",
       " 6,\n",
       " 7,\n",
       " 8,\n",
       " 9,\n",
       " 10,\n",
       " 11,\n",
       " 12,\n",
       " 13,\n",
       " 14,\n",
       " 15,\n",
       " 16,\n",
       " 17,\n",
       " 18,\n",
       " 19,\n",
       " 20,\n",
       " 21,\n",
       " 22,\n",
       " 23,\n",
       " 24,\n",
       " 25,\n",
       " 26,\n",
       " 27,\n",
       " 28,\n",
       " 29,\n",
       " 30,\n",
       " 31,\n",
       " 32,\n",
       " 33,\n",
       " 34,\n",
       " 35,\n",
       " 36,\n",
       " 37,\n",
       " 38,\n",
       " 39,\n",
       " 40,\n",
       " 41,\n",
       " 42,\n",
       " 43,\n",
       " 44,\n",
       " 45,\n",
       " 46,\n",
       " 47,\n",
       " 48,\n",
       " 49,\n",
       " 50,\n",
       " 51,\n",
       " 52,\n",
       " 53,\n",
       " 54,\n",
       " 55,\n",
       " 56,\n",
       " 57,\n",
       " 58,\n",
       " 59,\n",
       " 60,\n",
       " 61,\n",
       " 62,\n",
       " 63,\n",
       " 64,\n",
       " 65,\n",
       " 66,\n",
       " 67,\n",
       " 68,\n",
       " 69,\n",
       " 70,\n",
       " 71,\n",
       " 72,\n",
       " 73,\n",
       " 74,\n",
       " 75,\n",
       " 76,\n",
       " 77,\n",
       " 78,\n",
       " 79,\n",
       " 80,\n",
       " 81,\n",
       " 82,\n",
       " 83,\n",
       " 84,\n",
       " 85,\n",
       " 86,\n",
       " 87,\n",
       " 88,\n",
       " 89,\n",
       " 90,\n",
       " 91,\n",
       " 92,\n",
       " 93,\n",
       " 94,\n",
       " 95,\n",
       " 96,\n",
       " 97,\n",
       " 98,\n",
       " 99,\n",
       " 100,\n",
       " 101,\n",
       " 102,\n",
       " 103,\n",
       " 104,\n",
       " 105,\n",
       " 106,\n",
       " 107,\n",
       " 108,\n",
       " 109,\n",
       " 110,\n",
       " 111,\n",
       " 112,\n",
       " 113,\n",
       " 114,\n",
       " 115,\n",
       " 116,\n",
       " 117,\n",
       " 118,\n",
       " 119,\n",
       " 120,\n",
       " 121,\n",
       " 122,\n",
       " 123,\n",
       " 124,\n",
       " 125,\n",
       " 126,\n",
       " 127,\n",
       " 128,\n",
       " 129,\n",
       " 130,\n",
       " 131,\n",
       " 132,\n",
       " 133,\n",
       " 134,\n",
       " 135,\n",
       " 136,\n",
       " 137,\n",
       " 138,\n",
       " 139,\n",
       " 140,\n",
       " 141,\n",
       " 142,\n",
       " 143,\n",
       " 144,\n",
       " 145,\n",
       " 146,\n",
       " 147,\n",
       " 148,\n",
       " 149]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "row_index_list = list(iris_df.index)\n",
    "row_index_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "b28c9b2a-96a3-4d83-a1a9-beabb81bb9f0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['sepal_length', 'sepal_width', 'petal_length', 'petal_width',\n",
       "       'species'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pandas.DataFrame.columns\n",
    "iris_df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "03b04e87-4aad-4924-a2c3-20b16830a8d9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'species']"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(iris_df.columns)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4e813b50-40ec-4b8a-8717-9fa6a5237466",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[RangeIndex(start=0, stop=150, step=1),\n",
       " Index(['sepal_length', 'sepal_width', 'petal_length', 'petal_width',\n",
       "        'species'],\n",
       "       dtype='object')]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pandas.DataFrame.axes\n",
    "iris_df.axes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "7454721d-6fd7-48fe-8f17-2595a49bec82",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.frame.DataFrame"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 判断数据类型\n",
    "type(iris_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "428748e9-e4f4-412a-bc12-69cb6cd3b1fd",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 150 entries, 0 to 149\n",
      "Data columns (total 5 columns):\n",
      " #   Column        Non-Null Count  Dtype  \n",
      "---  ------        --------------  -----  \n",
      " 0   sepal_length  150 non-null    float64\n",
      " 1   sepal_width   150 non-null    float64\n",
      " 2   petal_length  150 non-null    float64\n",
      " 3   petal_width   150 non-null    float64\n",
      " 4   species       150 non-null    object \n",
      "dtypes: float64(4), object(1)\n",
      "memory usage: 6.0+ KB\n"
     ]
    }
   ],
   "source": [
    "# 数据帧信息汇总\n",
    "iris_df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "c98321dd-bf54-4e00-a915-6f52b8e91926",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.1, 3.5, 1.4, 0.2, 'setosa'],\n",
       "       [4.9, 3.0, 1.4, 0.2, 'setosa'],\n",
       "       [4.7, 3.2, 1.3, 0.2, 'setosa'],\n",
       "       [4.6, 3.1, 1.5, 0.2, 'setosa'],\n",
       "       [5.0, 3.6, 1.4, 0.2, 'setosa'],\n",
       "       [5.4, 3.9, 1.7, 0.4, 'setosa'],\n",
       "       [4.6, 3.4, 1.4, 0.3, 'setosa'],\n",
       "       [5.0, 3.4, 1.5, 0.2, 'setosa'],\n",
       "       [4.4, 2.9, 1.4, 0.2, 'setosa'],\n",
       "       [4.9, 3.1, 1.5, 0.1, 'setosa'],\n",
       "       [5.4, 3.7, 1.5, 0.2, 'setosa'],\n",
       "       [4.8, 3.4, 1.6, 0.2, 'setosa'],\n",
       "       [4.8, 3.0, 1.4, 0.1, 'setosa'],\n",
       "       [4.3, 3.0, 1.1, 0.1, 'setosa'],\n",
       "       [5.8, 4.0, 1.2, 0.2, 'setosa'],\n",
       "       [5.7, 4.4, 1.5, 0.4, 'setosa'],\n",
       "       [5.4, 3.9, 1.3, 0.4, 'setosa'],\n",
       "       [5.1, 3.5, 1.4, 0.3, 'setosa'],\n",
       "       [5.7, 3.8, 1.7, 0.3, 'setosa'],\n",
       "       [5.1, 3.8, 1.5, 0.3, 'setosa'],\n",
       "       [5.4, 3.4, 1.7, 0.2, 'setosa'],\n",
       "       [5.1, 3.7, 1.5, 0.4, 'setosa'],\n",
       "       [4.6, 3.6, 1.0, 0.2, 'setosa'],\n",
       "       [5.1, 3.3, 1.7, 0.5, 'setosa'],\n",
       "       [4.8, 3.4, 1.9, 0.2, 'setosa'],\n",
       "       [5.0, 3.0, 1.6, 0.2, 'setosa'],\n",
       "       [5.0, 3.4, 1.6, 0.4, 'setosa'],\n",
       "       [5.2, 3.5, 1.5, 0.2, 'setosa'],\n",
       "       [5.2, 3.4, 1.4, 0.2, 'setosa'],\n",
       "       [4.7, 3.2, 1.6, 0.2, 'setosa'],\n",
       "       [4.8, 3.1, 1.6, 0.2, 'setosa'],\n",
       "       [5.4, 3.4, 1.5, 0.4, 'setosa'],\n",
       "       [5.2, 4.1, 1.5, 0.1, 'setosa'],\n",
       "       [5.5, 4.2, 1.4, 0.2, 'setosa'],\n",
       "       [4.9, 3.1, 1.5, 0.2, 'setosa'],\n",
       "       [5.0, 3.2, 1.2, 0.2, 'setosa'],\n",
       "       [5.5, 3.5, 1.3, 0.2, 'setosa'],\n",
       "       [4.9, 3.6, 1.4, 0.1, 'setosa'],\n",
       "       [4.4, 3.0, 1.3, 0.2, 'setosa'],\n",
       "       [5.1, 3.4, 1.5, 0.2, 'setosa'],\n",
       "       [5.0, 3.5, 1.3, 0.3, 'setosa'],\n",
       "       [4.5, 2.3, 1.3, 0.3, 'setosa'],\n",
       "       [4.4, 3.2, 1.3, 0.2, 'setosa'],\n",
       "       [5.0, 3.5, 1.6, 0.6, 'setosa'],\n",
       "       [5.1, 3.8, 1.9, 0.4, 'setosa'],\n",
       "       [4.8, 3.0, 1.4, 0.3, 'setosa'],\n",
       "       [5.1, 3.8, 1.6, 0.2, 'setosa'],\n",
       "       [4.6, 3.2, 1.4, 0.2, 'setosa'],\n",
       "       [5.3, 3.7, 1.5, 0.2, 'setosa'],\n",
       "       [5.0, 3.3, 1.4, 0.2, 'setosa'],\n",
       "       [7.0, 3.2, 4.7, 1.4, 'versicolor'],\n",
       "       [6.4, 3.2, 4.5, 1.5, 'versicolor'],\n",
       "       [6.9, 3.1, 4.9, 1.5, 'versicolor'],\n",
       "       [5.5, 2.3, 4.0, 1.3, 'versicolor'],\n",
       "       [6.5, 2.8, 4.6, 1.5, 'versicolor'],\n",
       "       [5.7, 2.8, 4.5, 1.3, 'versicolor'],\n",
       "       [6.3, 3.3, 4.7, 1.6, 'versicolor'],\n",
       "       [4.9, 2.4, 3.3, 1.0, 'versicolor'],\n",
       "       [6.6, 2.9, 4.6, 1.3, 'versicolor'],\n",
       "       [5.2, 2.7, 3.9, 1.4, 'versicolor'],\n",
       "       [5.0, 2.0, 3.5, 1.0, 'versicolor'],\n",
       "       [5.9, 3.0, 4.2, 1.5, 'versicolor'],\n",
       "       [6.0, 2.2, 4.0, 1.0, 'versicolor'],\n",
       "       [6.1, 2.9, 4.7, 1.4, 'versicolor'],\n",
       "       [5.6, 2.9, 3.6, 1.3, 'versicolor'],\n",
       "       [6.7, 3.1, 4.4, 1.4, 'versicolor'],\n",
       "       [5.6, 3.0, 4.5, 1.5, 'versicolor'],\n",
       "       [5.8, 2.7, 4.1, 1.0, 'versicolor'],\n",
       "       [6.2, 2.2, 4.5, 1.5, 'versicolor'],\n",
       "       [5.6, 2.5, 3.9, 1.1, 'versicolor'],\n",
       "       [5.9, 3.2, 4.8, 1.8, 'versicolor'],\n",
       "       [6.1, 2.8, 4.0, 1.3, 'versicolor'],\n",
       "       [6.3, 2.5, 4.9, 1.5, 'versicolor'],\n",
       "       [6.1, 2.8, 4.7, 1.2, 'versicolor'],\n",
       "       [6.4, 2.9, 4.3, 1.3, 'versicolor'],\n",
       "       [6.6, 3.0, 4.4, 1.4, 'versicolor'],\n",
       "       [6.8, 2.8, 4.8, 1.4, 'versicolor'],\n",
       "       [6.7, 3.0, 5.0, 1.7, 'versicolor'],\n",
       "       [6.0, 2.9, 4.5, 1.5, 'versicolor'],\n",
       "       [5.7, 2.6, 3.5, 1.0, 'versicolor'],\n",
       "       [5.5, 2.4, 3.8, 1.1, 'versicolor'],\n",
       "       [5.5, 2.4, 3.7, 1.0, 'versicolor'],\n",
       "       [5.8, 2.7, 3.9, 1.2, 'versicolor'],\n",
       "       [6.0, 2.7, 5.1, 1.6, 'versicolor'],\n",
       "       [5.4, 3.0, 4.5, 1.5, 'versicolor'],\n",
       "       [6.0, 3.4, 4.5, 1.6, 'versicolor'],\n",
       "       [6.7, 3.1, 4.7, 1.5, 'versicolor'],\n",
       "       [6.3, 2.3, 4.4, 1.3, 'versicolor'],\n",
       "       [5.6, 3.0, 4.1, 1.3, 'versicolor'],\n",
       "       [5.5, 2.5, 4.0, 1.3, 'versicolor'],\n",
       "       [5.5, 2.6, 4.4, 1.2, 'versicolor'],\n",
       "       [6.1, 3.0, 4.6, 1.4, 'versicolor'],\n",
       "       [5.8, 2.6, 4.0, 1.2, 'versicolor'],\n",
       "       [5.0, 2.3, 3.3, 1.0, 'versicolor'],\n",
       "       [5.6, 2.7, 4.2, 1.3, 'versicolor'],\n",
       "       [5.7, 3.0, 4.2, 1.2, 'versicolor'],\n",
       "       [5.7, 2.9, 4.2, 1.3, 'versicolor'],\n",
       "       [6.2, 2.9, 4.3, 1.3, 'versicolor'],\n",
       "       [5.1, 2.5, 3.0, 1.1, 'versicolor'],\n",
       "       [5.7, 2.8, 4.1, 1.3, 'versicolor'],\n",
       "       [6.3, 3.3, 6.0, 2.5, 'virginica'],\n",
       "       [5.8, 2.7, 5.1, 1.9, 'virginica'],\n",
       "       [7.1, 3.0, 5.9, 2.1, 'virginica'],\n",
       "       [6.3, 2.9, 5.6, 1.8, 'virginica'],\n",
       "       [6.5, 3.0, 5.8, 2.2, 'virginica'],\n",
       "       [7.6, 3.0, 6.6, 2.1, 'virginica'],\n",
       "       [4.9, 2.5, 4.5, 1.7, 'virginica'],\n",
       "       [7.3, 2.9, 6.3, 1.8, 'virginica'],\n",
       "       [6.7, 2.5, 5.8, 1.8, 'virginica'],\n",
       "       [7.2, 3.6, 6.1, 2.5, 'virginica'],\n",
       "       [6.5, 3.2, 5.1, 2.0, 'virginica'],\n",
       "       [6.4, 2.7, 5.3, 1.9, 'virginica'],\n",
       "       [6.8, 3.0, 5.5, 2.1, 'virginica'],\n",
       "       [5.7, 2.5, 5.0, 2.0, 'virginica'],\n",
       "       [5.8, 2.8, 5.1, 2.4, 'virginica'],\n",
       "       [6.4, 3.2, 5.3, 2.3, 'virginica'],\n",
       "       [6.5, 3.0, 5.5, 1.8, 'virginica'],\n",
       "       [7.7, 3.8, 6.7, 2.2, 'virginica'],\n",
       "       [7.7, 2.6, 6.9, 2.3, 'virginica'],\n",
       "       [6.0, 2.2, 5.0, 1.5, 'virginica'],\n",
       "       [6.9, 3.2, 5.7, 2.3, 'virginica'],\n",
       "       [5.6, 2.8, 4.9, 2.0, 'virginica'],\n",
       "       [7.7, 2.8, 6.7, 2.0, 'virginica'],\n",
       "       [6.3, 2.7, 4.9, 1.8, 'virginica'],\n",
       "       [6.7, 3.3, 5.7, 2.1, 'virginica'],\n",
       "       [7.2, 3.2, 6.0, 1.8, 'virginica'],\n",
       "       [6.2, 2.8, 4.8, 1.8, 'virginica'],\n",
       "       [6.1, 3.0, 4.9, 1.8, 'virginica'],\n",
       "       [6.4, 2.8, 5.6, 2.1, 'virginica'],\n",
       "       [7.2, 3.0, 5.8, 1.6, 'virginica'],\n",
       "       [7.4, 2.8, 6.1, 1.9, 'virginica'],\n",
       "       [7.9, 3.8, 6.4, 2.0, 'virginica'],\n",
       "       [6.4, 2.8, 5.6, 2.2, 'virginica'],\n",
       "       [6.3, 2.8, 5.1, 1.5, 'virginica'],\n",
       "       [6.1, 2.6, 5.6, 1.4, 'virginica'],\n",
       "       [7.7, 3.0, 6.1, 2.3, 'virginica'],\n",
       "       [6.3, 3.4, 5.6, 2.4, 'virginica'],\n",
       "       [6.4, 3.1, 5.5, 1.8, 'virginica'],\n",
       "       [6.0, 3.0, 4.8, 1.8, 'virginica'],\n",
       "       [6.9, 3.1, 5.4, 2.1, 'virginica'],\n",
       "       [6.7, 3.1, 5.6, 2.4, 'virginica'],\n",
       "       [6.9, 3.1, 5.1, 2.3, 'virginica'],\n",
       "       [5.8, 2.7, 5.1, 1.9, 'virginica'],\n",
       "       [6.8, 3.2, 5.9, 2.3, 'virginica'],\n",
       "       [6.7, 3.3, 5.7, 2.5, 'virginica'],\n",
       "       [6.7, 3.0, 5.2, 2.3, 'virginica'],\n",
       "       [6.3, 2.5, 5.0, 1.9, 'virginica'],\n",
       "       [6.5, 3.0, 5.2, 2.0, 'virginica'],\n",
       "       [6.2, 3.4, 5.4, 2.3, 'virginica'],\n",
       "       [5.9, 3.0, 5.1, 1.8, 'virginica']], dtype=object)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pandas.DataFrame.values\n",
    "iris_df.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a5e0fe9e-bfb5-422f-99db-03fbf208d44c",
   "metadata": {},
   "outputs": [],
   "source": [
    "# pandas.DataFrame.describe\n",
    "iris_df.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "id": "338ce884-d0b0-4a93-8593-f544da144780",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>150.0</td>\n",
       "      <td>150.0</td>\n",
       "      <td>150.0</td>\n",
       "      <td>150.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>5.8</td>\n",
       "      <td>3.1</td>\n",
       "      <td>3.8</td>\n",
       "      <td>1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.8</td>\n",
       "      <td>0.4</td>\n",
       "      <td>1.8</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>4.3</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>5.1</td>\n",
       "      <td>2.8</td>\n",
       "      <td>1.6</td>\n",
       "      <td>0.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>5.8</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4.4</td>\n",
       "      <td>1.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>6.4</td>\n",
       "      <td>3.3</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>7.9</td>\n",
       "      <td>4.4</td>\n",
       "      <td>6.9</td>\n",
       "      <td>2.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       sepal_length  sepal_width  petal_length  petal_width\n",
       "count         150.0        150.0         150.0        150.0\n",
       "mean            5.8          3.1           3.8          1.2\n",
       "std             0.8          0.4           1.8          0.8\n",
       "min             4.3          2.0           1.0          0.1\n",
       "25%             5.1          2.8           1.6          0.3\n",
       "50%             5.8          3.0           4.4          1.3\n",
       "75%             6.4          3.3           5.1          1.8\n",
       "max             7.9          4.4           6.9          2.5"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 小数点后一位\n",
    "iris_df.describe().round(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "cd23e0a7-e285-4a8f-a841-c4852e03247f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sepal_length    35\n",
       "sepal_width     23\n",
       "petal_length    43\n",
       "petal_width     22\n",
       "species          3\n",
       "dtype: int64"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pandas.DataFrame.nunique\n",
    "iris_df.nunique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "64f47d45-45d7-40eb-a6e2-28642d41c2fc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['setosa', 'versicolor', 'virginica'], dtype=object)"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df['species'].unique()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "38d154b1-e05c-4c78-90f9-03655557e6cb",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "bc9083f7-76f8-457e-80ed-aab0aa69ecc8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sepal_length  sepal_width  petal_length  petal_width species\n",
       "0           5.1          3.5           1.4          0.2  setosa\n",
       "1           4.9          3.0           1.4          0.2  setosa\n",
       "2           4.7          3.2           1.3          0.2  setosa\n",
       "3           4.6          3.1           1.5          0.2  setosa\n",
       "4           5.0          3.6           1.4          0.2  setosa"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 打印数据帧前5行\n",
    "iris_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "297bfe6b-a662-49d5-a221-8cd472e0354f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     sepal_length  sepal_width  petal_length  petal_width    species\n",
       "145           6.7          3.0           5.2          2.3  virginica\n",
       "146           6.3          2.5           5.0          1.9  virginica\n",
       "147           6.5          3.0           5.2          2.0  virginica\n",
       "148           6.2          3.4           5.4          2.3  virginica\n",
       "149           5.9          3.0           5.1          1.8  virginica"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 打印数据帧后5行\n",
    "iris_df.tail()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9970dd45-593e-4f82-a63a-672deeaf319e",
   "metadata": {},
   "source": [
    "### 形状"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "d7b13952-1c0d-4c49-9fe8-5b7229e127d7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(150, 5)"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 数据帧本质上就是一个表格\n",
    "# 获取数据帧形状\n",
    "# pandas.DataFrame.shape\n",
    "iris_df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "77ee8c7c-e072-41ea-a1dc-f34428bb7f6e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# pandas.DataFrame.ndim"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "2994fa42-7c56-4bec-bfef-e382f088eed3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "750"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 获取表格元素总数\n",
    "# pandas.DataFrame.size\n",
    "iris_df.size"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "15855f52-b5b6-4f0b-adcb-42f60597bda3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sepal_length    150\n",
       "sepal_width     150\n",
       "petal_length    150\n",
       "petal_width     150\n",
       "species         150\n",
       "dtype: int64"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 每一列非缺失值的数量\n",
    "# pandas.DataFrame.count\n",
    "iris_df.count()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "22304104-d4da-4b56-b2fc-92b5af618c4b",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(iris_df.count(axis = 1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "42d80b7f-b613-459c-9d11-fbabdaea1c88",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sepal_length    100.0\n",
       "sepal_width     100.0\n",
       "petal_length    100.0\n",
       "petal_width     100.0\n",
       "species         100.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.count() * 100 / len(iris_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "e03893b6-5350-47c3-a3a3-43937cb09dbf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     sepal_length  sepal_width  petal_length  petal_width  species\n",
       "0           False        False         False        False    False\n",
       "1           False        False         False        False    False\n",
       "2           False        False         False        False    False\n",
       "3           False        False         False        False    False\n",
       "4           False        False         False        False    False\n",
       "..            ...          ...           ...          ...      ...\n",
       "145         False        False         False        False    False\n",
       "146         False        False         False        False    False\n",
       "147         False        False         False        False    False\n",
       "148         False        False         False        False    False\n",
       "149         False        False         False        False    False\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# pandas.DataFrame.isnull\n",
    "iris_df.isnull()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "bd5d21df-c056-4955-a4e6-f5fa05f1c5e3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "sepal_length    0.0\n",
       "sepal_width     0.0\n",
       "petal_length    0.0\n",
       "petal_width     0.0\n",
       "species         0.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.isnull().sum() * 100 / len(iris_df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "941c439e-e755-4602-a016-e6046cf14a1e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0      5\n",
      "1      5\n",
      "2      5\n",
      "3      5\n",
      "4      5\n",
      "      ..\n",
      "145    5\n",
      "146    5\n",
      "147    5\n",
      "148    5\n",
      "149    5\n",
      "Length: 150, dtype: int64\n"
     ]
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "6806848a-dc13-4aab-bd1c-e6978ebe30b9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "150\n",
      "150\n",
      "150\n",
      "150\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "150"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 获取数据帧行数，几种不同方法\n",
    "print(iris_df.shape[0])\n",
    "print(len(iris_df))\n",
    "print(len(iris_df.index)) \n",
    "print(iris_df[iris_df.columns[0]].count())\n",
    "num_rows = len(iris_df.axes[0])\n",
    "num_rows"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "383ac153-02a0-4dc5-8675-823f3b992921",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5\n",
      "5\n",
      "5\n",
      "5\n"
     ]
    }
   ],
   "source": [
    "# 获取数据帧列数，几种不同方法\n",
    "print(iris_df.shape[1])\n",
    "print(len(iris_df.T))\n",
    "print(len(iris_df.columns))\n",
    "print(len(iris_df.axes[1]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "d301f4eb-a82e-4942-8387-62db3a1abd1e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['sepal_length', 'sepal_width', 'petal_length', 'petal_width',\n",
       "       'species'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 获得表头名称\n",
    "iris_df.columns"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1cfd34f3-73a7-4444-a9d0-dec3710541dd",
   "metadata": {},
   "source": [
    "### 循环"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "8286610a-2d2e-4de8-966f-d5c9b5452edc",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "=================\n",
      "Row index = 0\n",
      "5.1 3.5\n",
      "=================\n",
      "Row index = 1\n",
      "4.9 3.0\n",
      "=================\n",
      "Row index = 2\n",
      "4.7 3.2\n",
      "=================\n",
      "Row index = 3\n",
      "4.6 3.1\n",
      "=================\n",
      "Row index = 4\n",
      "5.0 3.6\n",
      "=================\n",
      "Row index = 5\n",
      "5.4 3.9\n",
      "=================\n",
      "Row index = 6\n",
      "4.6 3.4\n",
      "=================\n",
      "Row index = 7\n",
      "5.0 3.4\n",
      "=================\n",
      "Row index = 8\n",
      "4.4 2.9\n",
      "=================\n",
      "Row index = 9\n",
      "4.9 3.1\n",
      "=================\n",
      "Row index = 10\n",
      "5.4 3.7\n",
      "=================\n",
      "Row index = 11\n",
      "4.8 3.4\n",
      "=================\n",
      "Row index = 12\n",
      "4.8 3.0\n",
      "=================\n",
      "Row index = 13\n",
      "4.3 3.0\n",
      "=================\n",
      "Row index = 14\n",
      "5.8 4.0\n",
      "=================\n",
      "Row index = 15\n",
      "5.7 4.4\n",
      "=================\n",
      "Row index = 16\n",
      "5.4 3.9\n",
      "=================\n",
      "Row index = 17\n",
      "5.1 3.5\n",
      "=================\n",
      "Row index = 18\n",
      "5.7 3.8\n",
      "=================\n",
      "Row index = 19\n",
      "5.1 3.8\n",
      "=================\n",
      "Row index = 20\n",
      "5.4 3.4\n",
      "=================\n",
      "Row index = 21\n",
      "5.1 3.7\n",
      "=================\n",
      "Row index = 22\n",
      "4.6 3.6\n",
      "=================\n",
      "Row index = 23\n",
      "5.1 3.3\n",
      "=================\n",
      "Row index = 24\n",
      "4.8 3.4\n",
      "=================\n",
      "Row index = 25\n",
      "5.0 3.0\n",
      "=================\n",
      "Row index = 26\n",
      "5.0 3.4\n",
      "=================\n",
      "Row index = 27\n",
      "5.2 3.5\n",
      "=================\n",
      "Row index = 28\n",
      "5.2 3.4\n",
      "=================\n",
      "Row index = 29\n",
      "4.7 3.2\n",
      "=================\n",
      "Row index = 30\n",
      "4.8 3.1\n",
      "=================\n",
      "Row index = 31\n",
      "5.4 3.4\n",
      "=================\n",
      "Row index = 32\n",
      "5.2 4.1\n",
      "=================\n",
      "Row index = 33\n",
      "5.5 4.2\n",
      "=================\n",
      "Row index = 34\n",
      "4.9 3.1\n",
      "=================\n",
      "Row index = 35\n",
      "5.0 3.2\n",
      "=================\n",
      "Row index = 36\n",
      "5.5 3.5\n",
      "=================\n",
      "Row index = 37\n",
      "4.9 3.6\n",
      "=================\n",
      "Row index = 38\n",
      "4.4 3.0\n",
      "=================\n",
      "Row index = 39\n",
      "5.1 3.4\n",
      "=================\n",
      "Row index = 40\n",
      "5.0 3.5\n",
      "=================\n",
      "Row index = 41\n",
      "4.5 2.3\n",
      "=================\n",
      "Row index = 42\n",
      "4.4 3.2\n",
      "=================\n",
      "Row index = 43\n",
      "5.0 3.5\n",
      "=================\n",
      "Row index = 44\n",
      "5.1 3.8\n",
      "=================\n",
      "Row index = 45\n",
      "4.8 3.0\n",
      "=================\n",
      "Row index = 46\n",
      "5.1 3.8\n",
      "=================\n",
      "Row index = 47\n",
      "4.6 3.2\n",
      "=================\n",
      "Row index = 48\n",
      "5.3 3.7\n",
      "=================\n",
      "Row index = 49\n",
      "5.0 3.3\n",
      "=================\n",
      "Row index = 50\n",
      "7.0 3.2\n",
      "=================\n",
      "Row index = 51\n",
      "6.4 3.2\n",
      "=================\n",
      "Row index = 52\n",
      "6.9 3.1\n",
      "=================\n",
      "Row index = 53\n",
      "5.5 2.3\n",
      "=================\n",
      "Row index = 54\n",
      "6.5 2.8\n",
      "=================\n",
      "Row index = 55\n",
      "5.7 2.8\n",
      "=================\n",
      "Row index = 56\n",
      "6.3 3.3\n",
      "=================\n",
      "Row index = 57\n",
      "4.9 2.4\n",
      "=================\n",
      "Row index = 58\n",
      "6.6 2.9\n",
      "=================\n",
      "Row index = 59\n",
      "5.2 2.7\n",
      "=================\n",
      "Row index = 60\n",
      "5.0 2.0\n",
      "=================\n",
      "Row index = 61\n",
      "5.9 3.0\n",
      "=================\n",
      "Row index = 62\n",
      "6.0 2.2\n",
      "=================\n",
      "Row index = 63\n",
      "6.1 2.9\n",
      "=================\n",
      "Row index = 64\n",
      "5.6 2.9\n",
      "=================\n",
      "Row index = 65\n",
      "6.7 3.1\n",
      "=================\n",
      "Row index = 66\n",
      "5.6 3.0\n",
      "=================\n",
      "Row index = 67\n",
      "5.8 2.7\n",
      "=================\n",
      "Row index = 68\n",
      "6.2 2.2\n",
      "=================\n",
      "Row index = 69\n",
      "5.6 2.5\n",
      "=================\n",
      "Row index = 70\n",
      "5.9 3.2\n",
      "=================\n",
      "Row index = 71\n",
      "6.1 2.8\n",
      "=================\n",
      "Row index = 72\n",
      "6.3 2.5\n",
      "=================\n",
      "Row index = 73\n",
      "6.1 2.8\n",
      "=================\n",
      "Row index = 74\n",
      "6.4 2.9\n",
      "=================\n",
      "Row index = 75\n",
      "6.6 3.0\n",
      "=================\n",
      "Row index = 76\n",
      "6.8 2.8\n",
      "=================\n",
      "Row index = 77\n",
      "6.7 3.0\n",
      "=================\n",
      "Row index = 78\n",
      "6.0 2.9\n",
      "=================\n",
      "Row index = 79\n",
      "5.7 2.6\n",
      "=================\n",
      "Row index = 80\n",
      "5.5 2.4\n",
      "=================\n",
      "Row index = 81\n",
      "5.5 2.4\n",
      "=================\n",
      "Row index = 82\n",
      "5.8 2.7\n",
      "=================\n",
      "Row index = 83\n",
      "6.0 2.7\n",
      "=================\n",
      "Row index = 84\n",
      "5.4 3.0\n",
      "=================\n",
      "Row index = 85\n",
      "6.0 3.4\n",
      "=================\n",
      "Row index = 86\n",
      "6.7 3.1\n",
      "=================\n",
      "Row index = 87\n",
      "6.3 2.3\n",
      "=================\n",
      "Row index = 88\n",
      "5.6 3.0\n",
      "=================\n",
      "Row index = 89\n",
      "5.5 2.5\n",
      "=================\n",
      "Row index = 90\n",
      "5.5 2.6\n",
      "=================\n",
      "Row index = 91\n",
      "6.1 3.0\n",
      "=================\n",
      "Row index = 92\n",
      "5.8 2.6\n",
      "=================\n",
      "Row index = 93\n",
      "5.0 2.3\n",
      "=================\n",
      "Row index = 94\n",
      "5.6 2.7\n",
      "=================\n",
      "Row index = 95\n",
      "5.7 3.0\n",
      "=================\n",
      "Row index = 96\n",
      "5.7 2.9\n",
      "=================\n",
      "Row index = 97\n",
      "6.2 2.9\n",
      "=================\n",
      "Row index = 98\n",
      "5.1 2.5\n",
      "=================\n",
      "Row index = 99\n",
      "5.7 2.8\n",
      "=================\n",
      "Row index = 100\n",
      "6.3 3.3\n",
      "=================\n",
      "Row index = 101\n",
      "5.8 2.7\n",
      "=================\n",
      "Row index = 102\n",
      "7.1 3.0\n",
      "=================\n",
      "Row index = 103\n",
      "6.3 2.9\n",
      "=================\n",
      "Row index = 104\n",
      "6.5 3.0\n",
      "=================\n",
      "Row index = 105\n",
      "7.6 3.0\n",
      "=================\n",
      "Row index = 106\n",
      "4.9 2.5\n",
      "=================\n",
      "Row index = 107\n",
      "7.3 2.9\n",
      "=================\n",
      "Row index = 108\n",
      "6.7 2.5\n",
      "=================\n",
      "Row index = 109\n",
      "7.2 3.6\n",
      "=================\n",
      "Row index = 110\n",
      "6.5 3.2\n",
      "=================\n",
      "Row index = 111\n",
      "6.4 2.7\n",
      "=================\n",
      "Row index = 112\n",
      "6.8 3.0\n",
      "=================\n",
      "Row index = 113\n",
      "5.7 2.5\n",
      "=================\n",
      "Row index = 114\n",
      "5.8 2.8\n",
      "=================\n",
      "Row index = 115\n",
      "6.4 3.2\n",
      "=================\n",
      "Row index = 116\n",
      "6.5 3.0\n",
      "=================\n",
      "Row index = 117\n",
      "7.7 3.8\n",
      "=================\n",
      "Row index = 118\n",
      "7.7 2.6\n",
      "=================\n",
      "Row index = 119\n",
      "6.0 2.2\n",
      "=================\n",
      "Row index = 120\n",
      "6.9 3.2\n",
      "=================\n",
      "Row index = 121\n",
      "5.6 2.8\n",
      "=================\n",
      "Row index = 122\n",
      "7.7 2.8\n",
      "=================\n",
      "Row index = 123\n",
      "6.3 2.7\n",
      "=================\n",
      "Row index = 124\n",
      "6.7 3.3\n",
      "=================\n",
      "Row index = 125\n",
      "7.2 3.2\n",
      "=================\n",
      "Row index = 126\n",
      "6.2 2.8\n",
      "=================\n",
      "Row index = 127\n",
      "6.1 3.0\n",
      "=================\n",
      "Row index = 128\n",
      "6.4 2.8\n",
      "=================\n",
      "Row index = 129\n",
      "7.2 3.0\n",
      "=================\n",
      "Row index = 130\n",
      "7.4 2.8\n",
      "=================\n",
      "Row index = 131\n",
      "7.9 3.8\n",
      "=================\n",
      "Row index = 132\n",
      "6.4 2.8\n",
      "=================\n",
      "Row index = 133\n",
      "6.3 2.8\n",
      "=================\n",
      "Row index = 134\n",
      "6.1 2.6\n",
      "=================\n",
      "Row index = 135\n",
      "7.7 3.0\n",
      "=================\n",
      "Row index = 136\n",
      "6.3 3.4\n",
      "=================\n",
      "Row index = 137\n",
      "6.4 3.1\n",
      "=================\n",
      "Row index = 138\n",
      "6.0 3.0\n",
      "=================\n",
      "Row index = 139\n",
      "6.9 3.1\n",
      "=================\n",
      "Row index = 140\n",
      "6.7 3.1\n",
      "=================\n",
      "Row index = 141\n",
      "6.9 3.1\n",
      "=================\n",
      "Row index = 142\n",
      "5.8 2.7\n",
      "=================\n",
      "Row index = 143\n",
      "6.8 3.2\n",
      "=================\n",
      "Row index = 144\n",
      "6.7 3.3\n",
      "=================\n",
      "Row index = 145\n",
      "6.7 3.0\n",
      "=================\n",
      "Row index = 146\n",
      "6.3 2.5\n",
      "=================\n",
      "Row index = 147\n",
      "6.5 3.0\n",
      "=================\n",
      "Row index = 148\n",
      "6.2 3.4\n",
      "=================\n",
      "Row index = 149\n",
      "5.9 3.0\n"
     ]
    }
   ],
   "source": [
    "# iterate rows\n",
    "for idx, row_idx in iris_df.iterrows():\n",
    "    print('=================')\n",
    "    print('Row index =',str(idx))\n",
    "    print(row_idx['sepal_length'], row_idx['sepal_width'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "87d0931b-98bf-4a2c-bea4-f244a0aa22ad",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "sepal_length\n",
      "0      5.1\n",
      "1      4.9\n",
      "2      4.7\n",
      "3      4.6\n",
      "4      5.0\n",
      "      ... \n",
      "145    6.7\n",
      "146    6.3\n",
      "147    6.5\n",
      "148    6.2\n",
      "149    5.9\n",
      "Name: sepal_length, Length: 150, dtype: float64\n",
      "sepal_width\n",
      "0      3.5\n",
      "1      3.0\n",
      "2      3.2\n",
      "3      3.1\n",
      "4      3.6\n",
      "      ... \n",
      "145    3.0\n",
      "146    2.5\n",
      "147    3.0\n",
      "148    3.4\n",
      "149    3.0\n",
      "Name: sepal_width, Length: 150, dtype: float64\n",
      "petal_length\n",
      "0      1.4\n",
      "1      1.4\n",
      "2      1.3\n",
      "3      1.5\n",
      "4      1.4\n",
      "      ... \n",
      "145    5.2\n",
      "146    5.0\n",
      "147    5.2\n",
      "148    5.4\n",
      "149    5.1\n",
      "Name: petal_length, Length: 150, dtype: float64\n",
      "petal_width\n",
      "0      0.2\n",
      "1      0.2\n",
      "2      0.2\n",
      "3      0.2\n",
      "4      0.2\n",
      "      ... \n",
      "145    2.3\n",
      "146    1.9\n",
      "147    2.0\n",
      "148    2.3\n",
      "149    1.8\n",
      "Name: petal_width, Length: 150, dtype: float64\n",
      "species\n",
      "0         setosa\n",
      "1         setosa\n",
      "2         setosa\n",
      "3         setosa\n",
      "4         setosa\n",
      "         ...    \n",
      "145    virginica\n",
      "146    virginica\n",
      "147    virginica\n",
      "148    virginica\n",
      "149    virginica\n",
      "Name: species, Length: 150, dtype: object\n"
     ]
    }
   ],
   "source": [
    "# iterate column\n",
    "\n",
    "for column_idx in iris_df:\n",
    "    print(column_idx)\n",
    "    print(iris_df[column_idx])\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "e4f750a9-0921-4820-9267-876da1a20ac5",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('sepal_length', 0      5.1\n",
      "1      4.9\n",
      "2      4.7\n",
      "3      4.6\n",
      "4      5.0\n",
      "      ... \n",
      "145    6.7\n",
      "146    6.3\n",
      "147    6.5\n",
      "148    6.2\n",
      "149    5.9\n",
      "Name: sepal_length, Length: 150, dtype: float64)\n",
      "('sepal_width', 0      3.5\n",
      "1      3.0\n",
      "2      3.2\n",
      "3      3.1\n",
      "4      3.6\n",
      "      ... \n",
      "145    3.0\n",
      "146    2.5\n",
      "147    3.0\n",
      "148    3.4\n",
      "149    3.0\n",
      "Name: sepal_width, Length: 150, dtype: float64)\n",
      "('petal_length', 0      1.4\n",
      "1      1.4\n",
      "2      1.3\n",
      "3      1.5\n",
      "4      1.4\n",
      "      ... \n",
      "145    5.2\n",
      "146    5.0\n",
      "147    5.2\n",
      "148    5.4\n",
      "149    5.1\n",
      "Name: petal_length, Length: 150, dtype: float64)\n",
      "('petal_width', 0      0.2\n",
      "1      0.2\n",
      "2      0.2\n",
      "3      0.2\n",
      "4      0.2\n",
      "      ... \n",
      "145    2.3\n",
      "146    1.9\n",
      "147    2.0\n",
      "148    2.3\n",
      "149    1.8\n",
      "Name: petal_width, Length: 150, dtype: float64)\n",
      "('species', 0         setosa\n",
      "1         setosa\n",
      "2         setosa\n",
      "3         setosa\n",
      "4         setosa\n",
      "         ...    \n",
      "145    virginica\n",
      "146    virginica\n",
      "147    virginica\n",
      "148    virginica\n",
      "149    virginica\n",
      "Name: species, Length: 150, dtype: object)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\james\\AppData\\Local\\Temp\\ipykernel_10148\\2730655476.py:1: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead.\n",
      "  for column_idx in iris_df.iteritems():\n"
     ]
    }
   ],
   "source": [
    "for column_idx in iris_df.iteritems():\n",
    "    print(column_idx)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "866d33e3-257b-4f9d-b2d2-a3d1fc69a7de",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('sepal_length', 0      5.1\n",
      "1      4.9\n",
      "2      4.7\n",
      "3      4.6\n",
      "4      5.0\n",
      "      ... \n",
      "145    6.7\n",
      "146    6.3\n",
      "147    6.5\n",
      "148    6.2\n",
      "149    5.9\n",
      "Name: sepal_length, Length: 150, dtype: float64)\n",
      "('sepal_width', 0      3.5\n",
      "1      3.0\n",
      "2      3.2\n",
      "3      3.1\n",
      "4      3.6\n",
      "      ... \n",
      "145    3.0\n",
      "146    2.5\n",
      "147    3.0\n",
      "148    3.4\n",
      "149    3.0\n",
      "Name: sepal_width, Length: 150, dtype: float64)\n",
      "('petal_length', 0      1.4\n",
      "1      1.4\n",
      "2      1.3\n",
      "3      1.5\n",
      "4      1.4\n",
      "      ... \n",
      "145    5.2\n",
      "146    5.0\n",
      "147    5.2\n",
      "148    5.4\n",
      "149    5.1\n",
      "Name: petal_length, Length: 150, dtype: float64)\n",
      "('petal_width', 0      0.2\n",
      "1      0.2\n",
      "2      0.2\n",
      "3      0.2\n",
      "4      0.2\n",
      "      ... \n",
      "145    2.3\n",
      "146    1.9\n",
      "147    2.0\n",
      "148    2.3\n",
      "149    1.8\n",
      "Name: petal_width, Length: 150, dtype: float64)\n",
      "('species', 0         setosa\n",
      "1         setosa\n",
      "2         setosa\n",
      "3         setosa\n",
      "4         setosa\n",
      "         ...    \n",
      "145    virginica\n",
      "146    virginica\n",
      "147    virginica\n",
      "148    virginica\n",
      "149    virginica\n",
      "Name: species, Length: 150, dtype: object)\n"
     ]
    }
   ],
   "source": [
    "for column_idx in iris_df.items():\n",
    "    print(column_idx)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4cb6d655-d5db-469d-843c-91339d064ac3",
   "metadata": {},
   "source": [
    "### 转化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "id": "e590c9c6-552b-49a4-b79a-2424932c6469",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>140</th>\n",
       "      <th>141</th>\n",
       "      <th>142</th>\n",
       "      <th>143</th>\n",
       "      <th>144</th>\n",
       "      <th>145</th>\n",
       "      <th>146</th>\n",
       "      <th>147</th>\n",
       "      <th>148</th>\n",
       "      <th>149</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>sepal_length</th>\n",
       "      <td>5.1</td>\n",
       "      <td>4.9</td>\n",
       "      <td>4.7</td>\n",
       "      <td>4.6</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.4</td>\n",
       "      <td>4.6</td>\n",
       "      <td>5.0</td>\n",
       "      <td>4.4</td>\n",
       "      <td>4.9</td>\n",
       "      <td>...</td>\n",
       "      <td>6.7</td>\n",
       "      <td>6.9</td>\n",
       "      <td>5.8</td>\n",
       "      <td>6.8</td>\n",
       "      <td>6.7</td>\n",
       "      <td>6.7</td>\n",
       "      <td>6.3</td>\n",
       "      <td>6.5</td>\n",
       "      <td>6.2</td>\n",
       "      <td>5.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>sepal_width</th>\n",
       "      <td>3.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3.2</td>\n",
       "      <td>3.1</td>\n",
       "      <td>3.6</td>\n",
       "      <td>3.9</td>\n",
       "      <td>3.4</td>\n",
       "      <td>3.4</td>\n",
       "      <td>2.9</td>\n",
       "      <td>3.1</td>\n",
       "      <td>...</td>\n",
       "      <td>3.1</td>\n",
       "      <td>3.1</td>\n",
       "      <td>2.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>3.3</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>3.4</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>petal_length</th>\n",
       "      <td>1.4</td>\n",
       "      <td>1.4</td>\n",
       "      <td>1.3</td>\n",
       "      <td>1.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>1.7</td>\n",
       "      <td>1.4</td>\n",
       "      <td>1.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>1.5</td>\n",
       "      <td>...</td>\n",
       "      <td>5.6</td>\n",
       "      <td>5.1</td>\n",
       "      <td>5.1</td>\n",
       "      <td>5.9</td>\n",
       "      <td>5.7</td>\n",
       "      <td>5.2</td>\n",
       "      <td>5.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>5.4</td>\n",
       "      <td>5.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>petal_width</th>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.1</td>\n",
       "      <td>...</td>\n",
       "      <td>2.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>1.9</td>\n",
       "      <td>2.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>2.3</td>\n",
       "      <td>1.9</td>\n",
       "      <td>2.0</td>\n",
       "      <td>2.3</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>species</th>\n",
       "      <td>setosa</td>\n",
       "      <td>setosa</td>\n",
       "      <td>setosa</td>\n",
       "      <td>setosa</td>\n",
       "      <td>setosa</td>\n",
       "      <td>setosa</td>\n",
       "      <td>setosa</td>\n",
       "      <td>setosa</td>\n",
       "      <td>setosa</td>\n",
       "      <td>setosa</td>\n",
       "      <td>...</td>\n",
       "      <td>virginica</td>\n",
       "      <td>virginica</td>\n",
       "      <td>virginica</td>\n",
       "      <td>virginica</td>\n",
       "      <td>virginica</td>\n",
       "      <td>virginica</td>\n",
       "      <td>virginica</td>\n",
       "      <td>virginica</td>\n",
       "      <td>virginica</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 150 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                 0       1       2       3       4       5       6       7    \\\n",
       "sepal_length     5.1     4.9     4.7     4.6     5.0     5.4     4.6     5.0   \n",
       "sepal_width      3.5     3.0     3.2     3.1     3.6     3.9     3.4     3.4   \n",
       "petal_length     1.4     1.4     1.3     1.5     1.4     1.7     1.4     1.5   \n",
       "petal_width      0.2     0.2     0.2     0.2     0.2     0.4     0.3     0.2   \n",
       "species       setosa  setosa  setosa  setosa  setosa  setosa  setosa  setosa   \n",
       "\n",
       "                 8       9    ...        140        141        142        143  \\\n",
       "sepal_length     4.4     4.9  ...        6.7        6.9        5.8        6.8   \n",
       "sepal_width      2.9     3.1  ...        3.1        3.1        2.7        3.2   \n",
       "petal_length     1.4     1.5  ...        5.6        5.1        5.1        5.9   \n",
       "petal_width      0.2     0.1  ...        2.4        2.3        1.9        2.3   \n",
       "species       setosa  setosa  ...  virginica  virginica  virginica  virginica   \n",
       "\n",
       "                    144        145        146        147        148        149  \n",
       "sepal_length        6.7        6.7        6.3        6.5        6.2        5.9  \n",
       "sepal_width         3.3        3.0        2.5        3.0        3.4        3.0  \n",
       "petal_length        5.7        5.2        5.0        5.2        5.4        5.1  \n",
       "petal_width         2.5        2.3        1.9        2.0        2.3        1.8  \n",
       "species       virginica  virginica  virginica  virginica  virginica  virginica  \n",
       "\n",
       "[5 rows x 150 columns]"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 转置\n",
    "iris_df.T"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0dd613e9-d9a1-4ca3-8e93-6316c165d9f4",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将数据帧转化为numpy array\n",
    "iris_df_2_array = iris_df.to_numpy()\n",
    "iris_df_2_array"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "id": "c99970c2-e32b-4cf7-8a45-e4c5d37e14cf",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.1, 3.5, 1.4, 0.2],\n",
       "       [4.9, 3. , 1.4, 0.2],\n",
       "       [4.7, 3.2, 1.3, 0.2],\n",
       "       [4.6, 3.1, 1.5, 0.2],\n",
       "       [5. , 3.6, 1.4, 0.2],\n",
       "       [5.4, 3.9, 1.7, 0.4],\n",
       "       [4.6, 3.4, 1.4, 0.3],\n",
       "       [5. , 3.4, 1.5, 0.2],\n",
       "       [4.4, 2.9, 1.4, 0.2],\n",
       "       [4.9, 3.1, 1.5, 0.1],\n",
       "       [5.4, 3.7, 1.5, 0.2],\n",
       "       [4.8, 3.4, 1.6, 0.2],\n",
       "       [4.8, 3. , 1.4, 0.1],\n",
       "       [4.3, 3. , 1.1, 0.1],\n",
       "       [5.8, 4. , 1.2, 0.2],\n",
       "       [5.7, 4.4, 1.5, 0.4],\n",
       "       [5.4, 3.9, 1.3, 0.4],\n",
       "       [5.1, 3.5, 1.4, 0.3],\n",
       "       [5.7, 3.8, 1.7, 0.3],\n",
       "       [5.1, 3.8, 1.5, 0.3],\n",
       "       [5.4, 3.4, 1.7, 0.2],\n",
       "       [5.1, 3.7, 1.5, 0.4],\n",
       "       [4.6, 3.6, 1. , 0.2],\n",
       "       [5.1, 3.3, 1.7, 0.5],\n",
       "       [4.8, 3.4, 1.9, 0.2],\n",
       "       [5. , 3. , 1.6, 0.2],\n",
       "       [5. , 3.4, 1.6, 0.4],\n",
       "       [5.2, 3.5, 1.5, 0.2],\n",
       "       [5.2, 3.4, 1.4, 0.2],\n",
       "       [4.7, 3.2, 1.6, 0.2],\n",
       "       [4.8, 3.1, 1.6, 0.2],\n",
       "       [5.4, 3.4, 1.5, 0.4],\n",
       "       [5.2, 4.1, 1.5, 0.1],\n",
       "       [5.5, 4.2, 1.4, 0.2],\n",
       "       [4.9, 3.1, 1.5, 0.2],\n",
       "       [5. , 3.2, 1.2, 0.2],\n",
       "       [5.5, 3.5, 1.3, 0.2],\n",
       "       [4.9, 3.6, 1.4, 0.1],\n",
       "       [4.4, 3. , 1.3, 0.2],\n",
       "       [5.1, 3.4, 1.5, 0.2],\n",
       "       [5. , 3.5, 1.3, 0.3],\n",
       "       [4.5, 2.3, 1.3, 0.3],\n",
       "       [4.4, 3.2, 1.3, 0.2],\n",
       "       [5. , 3.5, 1.6, 0.6],\n",
       "       [5.1, 3.8, 1.9, 0.4],\n",
       "       [4.8, 3. , 1.4, 0.3],\n",
       "       [5.1, 3.8, 1.6, 0.2],\n",
       "       [4.6, 3.2, 1.4, 0.2],\n",
       "       [5.3, 3.7, 1.5, 0.2],\n",
       "       [5. , 3.3, 1.4, 0.2],\n",
       "       [7. , 3.2, 4.7, 1.4],\n",
       "       [6.4, 3.2, 4.5, 1.5],\n",
       "       [6.9, 3.1, 4.9, 1.5],\n",
       "       [5.5, 2.3, 4. , 1.3],\n",
       "       [6.5, 2.8, 4.6, 1.5],\n",
       "       [5.7, 2.8, 4.5, 1.3],\n",
       "       [6.3, 3.3, 4.7, 1.6],\n",
       "       [4.9, 2.4, 3.3, 1. ],\n",
       "       [6.6, 2.9, 4.6, 1.3],\n",
       "       [5.2, 2.7, 3.9, 1.4],\n",
       "       [5. , 2. , 3.5, 1. ],\n",
       "       [5.9, 3. , 4.2, 1.5],\n",
       "       [6. , 2.2, 4. , 1. ],\n",
       "       [6.1, 2.9, 4.7, 1.4],\n",
       "       [5.6, 2.9, 3.6, 1.3],\n",
       "       [6.7, 3.1, 4.4, 1.4],\n",
       "       [5.6, 3. , 4.5, 1.5],\n",
       "       [5.8, 2.7, 4.1, 1. ],\n",
       "       [6.2, 2.2, 4.5, 1.5],\n",
       "       [5.6, 2.5, 3.9, 1.1],\n",
       "       [5.9, 3.2, 4.8, 1.8],\n",
       "       [6.1, 2.8, 4. , 1.3],\n",
       "       [6.3, 2.5, 4.9, 1.5],\n",
       "       [6.1, 2.8, 4.7, 1.2],\n",
       "       [6.4, 2.9, 4.3, 1.3],\n",
       "       [6.6, 3. , 4.4, 1.4],\n",
       "       [6.8, 2.8, 4.8, 1.4],\n",
       "       [6.7, 3. , 5. , 1.7],\n",
       "       [6. , 2.9, 4.5, 1.5],\n",
       "       [5.7, 2.6, 3.5, 1. ],\n",
       "       [5.5, 2.4, 3.8, 1.1],\n",
       "       [5.5, 2.4, 3.7, 1. ],\n",
       "       [5.8, 2.7, 3.9, 1.2],\n",
       "       [6. , 2.7, 5.1, 1.6],\n",
       "       [5.4, 3. , 4.5, 1.5],\n",
       "       [6. , 3.4, 4.5, 1.6],\n",
       "       [6.7, 3.1, 4.7, 1.5],\n",
       "       [6.3, 2.3, 4.4, 1.3],\n",
       "       [5.6, 3. , 4.1, 1.3],\n",
       "       [5.5, 2.5, 4. , 1.3],\n",
       "       [5.5, 2.6, 4.4, 1.2],\n",
       "       [6.1, 3. , 4.6, 1.4],\n",
       "       [5.8, 2.6, 4. , 1.2],\n",
       "       [5. , 2.3, 3.3, 1. ],\n",
       "       [5.6, 2.7, 4.2, 1.3],\n",
       "       [5.7, 3. , 4.2, 1.2],\n",
       "       [5.7, 2.9, 4.2, 1.3],\n",
       "       [6.2, 2.9, 4.3, 1.3],\n",
       "       [5.1, 2.5, 3. , 1.1],\n",
       "       [5.7, 2.8, 4.1, 1.3],\n",
       "       [6.3, 3.3, 6. , 2.5],\n",
       "       [5.8, 2.7, 5.1, 1.9],\n",
       "       [7.1, 3. , 5.9, 2.1],\n",
       "       [6.3, 2.9, 5.6, 1.8],\n",
       "       [6.5, 3. , 5.8, 2.2],\n",
       "       [7.6, 3. , 6.6, 2.1],\n",
       "       [4.9, 2.5, 4.5, 1.7],\n",
       "       [7.3, 2.9, 6.3, 1.8],\n",
       "       [6.7, 2.5, 5.8, 1.8],\n",
       "       [7.2, 3.6, 6.1, 2.5],\n",
       "       [6.5, 3.2, 5.1, 2. ],\n",
       "       [6.4, 2.7, 5.3, 1.9],\n",
       "       [6.8, 3. , 5.5, 2.1],\n",
       "       [5.7, 2.5, 5. , 2. ],\n",
       "       [5.8, 2.8, 5.1, 2.4],\n",
       "       [6.4, 3.2, 5.3, 2.3],\n",
       "       [6.5, 3. , 5.5, 1.8],\n",
       "       [7.7, 3.8, 6.7, 2.2],\n",
       "       [7.7, 2.6, 6.9, 2.3],\n",
       "       [6. , 2.2, 5. , 1.5],\n",
       "       [6.9, 3.2, 5.7, 2.3],\n",
       "       [5.6, 2.8, 4.9, 2. ],\n",
       "       [7.7, 2.8, 6.7, 2. ],\n",
       "       [6.3, 2.7, 4.9, 1.8],\n",
       "       [6.7, 3.3, 5.7, 2.1],\n",
       "       [7.2, 3.2, 6. , 1.8],\n",
       "       [6.2, 2.8, 4.8, 1.8],\n",
       "       [6.1, 3. , 4.9, 1.8],\n",
       "       [6.4, 2.8, 5.6, 2.1],\n",
       "       [7.2, 3. , 5.8, 1.6],\n",
       "       [7.4, 2.8, 6.1, 1.9],\n",
       "       [7.9, 3.8, 6.4, 2. ],\n",
       "       [6.4, 2.8, 5.6, 2.2],\n",
       "       [6.3, 2.8, 5.1, 1.5],\n",
       "       [6.1, 2.6, 5.6, 1.4],\n",
       "       [7.7, 3. , 6.1, 2.3],\n",
       "       [6.3, 3.4, 5.6, 2.4],\n",
       "       [6.4, 3.1, 5.5, 1.8],\n",
       "       [6. , 3. , 4.8, 1.8],\n",
       "       [6.9, 3.1, 5.4, 2.1],\n",
       "       [6.7, 3.1, 5.6, 2.4],\n",
       "       [6.9, 3.1, 5.1, 2.3],\n",
       "       [5.8, 2.7, 5.1, 1.9],\n",
       "       [6.8, 3.2, 5.9, 2.3],\n",
       "       [6.7, 3.3, 5.7, 2.5],\n",
       "       [6.7, 3. , 5.2, 2.3],\n",
       "       [6.3, 2.5, 5. , 1.9],\n",
       "       [6.5, 3. , 5.2, 2. ],\n",
       "       [6.2, 3.4, 5.4, 2.3],\n",
       "       [5.9, 3. , 5.1, 1.8]])"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 数据帧前四列转化为numpy array\n",
    "iris_df_2_array_numeric = iris_df[iris_df.columns[:4]].to_numpy()\n",
    "iris_df_2_array_numeric"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "id": "9faf1e8f-ac6e-486e-a5d5-91e3969f85a6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(150, 4)"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df_2_array_numeric.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "id": "d6bee255-9f40-41ee-8f1b-2074e79ece37",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[5.1, 3.5],\n",
       "       [4.9, 3. ],\n",
       "       [4.7, 3.2],\n",
       "       [4.6, 3.1],\n",
       "       [5. , 3.6],\n",
       "       [5.4, 3.9],\n",
       "       [4.6, 3.4],\n",
       "       [5. , 3.4],\n",
       "       [4.4, 2.9],\n",
       "       [4.9, 3.1],\n",
       "       [5.4, 3.7],\n",
       "       [4.8, 3.4],\n",
       "       [4.8, 3. ],\n",
       "       [4.3, 3. ],\n",
       "       [5.8, 4. ],\n",
       "       [5.7, 4.4],\n",
       "       [5.4, 3.9],\n",
       "       [5.1, 3.5],\n",
       "       [5.7, 3.8],\n",
       "       [5.1, 3.8],\n",
       "       [5.4, 3.4],\n",
       "       [5.1, 3.7],\n",
       "       [4.6, 3.6],\n",
       "       [5.1, 3.3],\n",
       "       [4.8, 3.4],\n",
       "       [5. , 3. ],\n",
       "       [5. , 3.4],\n",
       "       [5.2, 3.5],\n",
       "       [5.2, 3.4],\n",
       "       [4.7, 3.2],\n",
       "       [4.8, 3.1],\n",
       "       [5.4, 3.4],\n",
       "       [5.2, 4.1],\n",
       "       [5.5, 4.2],\n",
       "       [4.9, 3.1],\n",
       "       [5. , 3.2],\n",
       "       [5.5, 3.5],\n",
       "       [4.9, 3.6],\n",
       "       [4.4, 3. ],\n",
       "       [5.1, 3.4],\n",
       "       [5. , 3.5],\n",
       "       [4.5, 2.3],\n",
       "       [4.4, 3.2],\n",
       "       [5. , 3.5],\n",
       "       [5.1, 3.8],\n",
       "       [4.8, 3. ],\n",
       "       [5.1, 3.8],\n",
       "       [4.6, 3.2],\n",
       "       [5.3, 3.7],\n",
       "       [5. , 3.3],\n",
       "       [7. , 3.2],\n",
       "       [6.4, 3.2],\n",
       "       [6.9, 3.1],\n",
       "       [5.5, 2.3],\n",
       "       [6.5, 2.8],\n",
       "       [5.7, 2.8],\n",
       "       [6.3, 3.3],\n",
       "       [4.9, 2.4],\n",
       "       [6.6, 2.9],\n",
       "       [5.2, 2.7],\n",
       "       [5. , 2. ],\n",
       "       [5.9, 3. ],\n",
       "       [6. , 2.2],\n",
       "       [6.1, 2.9],\n",
       "       [5.6, 2.9],\n",
       "       [6.7, 3.1],\n",
       "       [5.6, 3. ],\n",
       "       [5.8, 2.7],\n",
       "       [6.2, 2.2],\n",
       "       [5.6, 2.5],\n",
       "       [5.9, 3.2],\n",
       "       [6.1, 2.8],\n",
       "       [6.3, 2.5],\n",
       "       [6.1, 2.8],\n",
       "       [6.4, 2.9],\n",
       "       [6.6, 3. ],\n",
       "       [6.8, 2.8],\n",
       "       [6.7, 3. ],\n",
       "       [6. , 2.9],\n",
       "       [5.7, 2.6],\n",
       "       [5.5, 2.4],\n",
       "       [5.5, 2.4],\n",
       "       [5.8, 2.7],\n",
       "       [6. , 2.7],\n",
       "       [5.4, 3. ],\n",
       "       [6. , 3.4],\n",
       "       [6.7, 3.1],\n",
       "       [6.3, 2.3],\n",
       "       [5.6, 3. ],\n",
       "       [5.5, 2.5],\n",
       "       [5.5, 2.6],\n",
       "       [6.1, 3. ],\n",
       "       [5.8, 2.6],\n",
       "       [5. , 2.3],\n",
       "       [5.6, 2.7],\n",
       "       [5.7, 3. ],\n",
       "       [5.7, 2.9],\n",
       "       [6.2, 2.9],\n",
       "       [5.1, 2.5],\n",
       "       [5.7, 2.8],\n",
       "       [6.3, 3.3],\n",
       "       [5.8, 2.7],\n",
       "       [7.1, 3. ],\n",
       "       [6.3, 2.9],\n",
       "       [6.5, 3. ],\n",
       "       [7.6, 3. ],\n",
       "       [4.9, 2.5],\n",
       "       [7.3, 2.9],\n",
       "       [6.7, 2.5],\n",
       "       [7.2, 3.6],\n",
       "       [6.5, 3.2],\n",
       "       [6.4, 2.7],\n",
       "       [6.8, 3. ],\n",
       "       [5.7, 2.5],\n",
       "       [5.8, 2.8],\n",
       "       [6.4, 3.2],\n",
       "       [6.5, 3. ],\n",
       "       [7.7, 3.8],\n",
       "       [7.7, 2.6],\n",
       "       [6. , 2.2],\n",
       "       [6.9, 3.2],\n",
       "       [5.6, 2.8],\n",
       "       [7.7, 2.8],\n",
       "       [6.3, 2.7],\n",
       "       [6.7, 3.3],\n",
       "       [7.2, 3.2],\n",
       "       [6.2, 2.8],\n",
       "       [6.1, 3. ],\n",
       "       [6.4, 2.8],\n",
       "       [7.2, 3. ],\n",
       "       [7.4, 2.8],\n",
       "       [7.9, 3.8],\n",
       "       [6.4, 2.8],\n",
       "       [6.3, 2.8],\n",
       "       [6.1, 2.6],\n",
       "       [7.7, 3. ],\n",
       "       [6.3, 3.4],\n",
       "       [6.4, 3.1],\n",
       "       [6. , 3. ],\n",
       "       [6.9, 3.1],\n",
       "       [6.7, 3.1],\n",
       "       [6.9, 3.1],\n",
       "       [5.8, 2.7],\n",
       "       [6.8, 3.2],\n",
       "       [6.7, 3.3],\n",
       "       [6.7, 3. ],\n",
       "       [6.3, 2.5],\n",
       "       [6.5, 3. ],\n",
       "       [6.2, 3.4],\n",
       "       [5.9, 3. ]])"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 指定column名称，转化成numpy array\n",
    "iris_df_2_array_sepal = iris_df[['sepal_length','sepal_width']].to_numpy()\n",
    "iris_df_2_array_sepal"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "id": "83d3f811-2feb-4e64-b6e5-94051d78351d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(150, 2)"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df_2_array_sepal.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a1b3ac2b-f44c-429a-9a80-d62e3ca6ff00",
   "metadata": {},
   "source": [
    "### 更改表头"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "b0b6c964-96d8-46a3-b59e-64b7da75cfc1",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>X1</th>\n",
       "      <th>X2</th>\n",
       "      <th>X3</th>\n",
       "      <th>X4</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    X1   X2   X3   X4       Y\n",
       "0  5.1  3.5  1.4  0.2  setosa\n",
       "1  4.9  3.0  1.4  0.2  setosa\n",
       "2  4.7  3.2  1.3  0.2  setosa\n",
       "3  4.6  3.1  1.5  0.2  setosa\n",
       "4  5.0  3.6  1.4  0.2  setosa"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.rename(columns={'sepal_length': 'X1', \n",
    "                        'sepal_width':  'X2',\n",
    "                        'petal_length': 'X3',\n",
    "                        'petal_width':  'X4',\n",
    "                        'species':      'Y'})\n",
    "# 注意，函数输入增加 inplace=True，直接修改原数据帧表头"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "778cd7dc-2c54-4688-87f2-4543822a0890",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>X1</th>\n",
       "      <th>X2</th>\n",
       "      <th>X3</th>\n",
       "      <th>X4</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    X1   X2   X3   X4       Y\n",
       "0  5.1  3.5  1.4  0.2  setosa\n",
       "1  4.9  3.0  1.4  0.2  setosa\n",
       "2  4.7  3.2  1.3  0.2  setosa\n",
       "3  4.6  3.1  1.5  0.2  setosa\n",
       "4  5.0  3.6  1.4  0.2  setosa"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 另外两种新方法：\n",
    "iris_df.rename({'sepal_length': 'X1', \n",
    "                'sepal_width':  'X2',\n",
    "                'petal_length': 'X3',\n",
    "                'petal_width':  'X4',\n",
    "                'species':      'Y'},\n",
    "               axis = 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "af36b7a7-6a2b-45ef-a0f4-fd820cbc1792",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>X1</th>\n",
       "      <th>X2</th>\n",
       "      <th>X3</th>\n",
       "      <th>X4</th>\n",
       "      <th>Y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      X1   X2   X3   X4          Y\n",
       "0    5.1  3.5  1.4  0.2     setosa\n",
       "1    4.9  3.0  1.4  0.2     setosa\n",
       "2    4.7  3.2  1.3  0.2     setosa\n",
       "3    4.6  3.1  1.5  0.2     setosa\n",
       "4    5.0  3.6  1.4  0.2     setosa\n",
       "..   ...  ...  ...  ...        ...\n",
       "145  6.7  3.0  5.2  2.3  virginica\n",
       "146  6.3  2.5  5.0  1.9  virginica\n",
       "147  6.5  3.0  5.2  2.0  virginica\n",
       "148  6.2  3.4  5.4  2.3  virginica\n",
       "149  5.9  3.0  5.1  1.8  virginica\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.rename({'sepal_length': 'X1', \n",
    "                'sepal_width':  'X2',\n",
    "                'petal_length': 'X3',\n",
    "                'petal_width':  'X4',\n",
    "                'species':      'Y'},\n",
    "               axis = 'columns')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "eb2a39cb-b305-4c95-9c64-3834b1976aac",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length_col</th>\n",
       "      <th>sepal_width_col</th>\n",
       "      <th>petal_length_col</th>\n",
       "      <th>petal_width_col</th>\n",
       "      <th>species_col</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sepal_length_col  sepal_width_col  petal_length_col  petal_width_col  \\\n",
       "0               5.1              3.5               1.4              0.2   \n",
       "1               4.9              3.0               1.4              0.2   \n",
       "2               4.7              3.2               1.3              0.2   \n",
       "3               4.6              3.1               1.5              0.2   \n",
       "4               5.0              3.6               1.4              0.2   \n",
       "\n",
       "  species_col  \n",
       "0      setosa  \n",
       "1      setosa  \n",
       "2      setosa  \n",
       "3      setosa  \n",
       "4      setosa  "
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 加“根、缀”\n",
    "iris_df_suffix = iris_df.add_suffix('_col')\n",
    "iris_df_suffix.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "15f5d798-1fcc-4ce7-8605-40ba24cd947b",
   "metadata": {},
   "source": [
    "### 修改行索引"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "0a2fd12a-9228-419c-b246-4079b07ab7b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>idx_0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         sepal_length  sepal_width  petal_length  petal_width    species\n",
       "idx_0             5.1          3.5           1.4          0.2     setosa\n",
       "idx_1             4.9          3.0           1.4          0.2     setosa\n",
       "idx_2             4.7          3.2           1.3          0.2     setosa\n",
       "idx_3             4.6          3.1           1.5          0.2     setosa\n",
       "idx_4             5.0          3.6           1.4          0.2     setosa\n",
       "...               ...          ...           ...          ...        ...\n",
       "idx_145           6.7          3.0           5.2          2.3  virginica\n",
       "idx_146           6.3          2.5           5.0          1.9  virginica\n",
       "idx_147           6.5          3.0           5.2          2.0  virginica\n",
       "idx_148           6.2          3.4           5.4          2.3  virginica\n",
       "idx_149           5.9          3.0           5.1          1.8  virginica\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.rename(lambda x: f'idx_{x}')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "00b09a62-567b-4395-81f5-9d1c0880a6bb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0_idx</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1_idx</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2_idx</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3_idx</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4_idx</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145_idx</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146_idx</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147_idx</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148_idx</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149_idx</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         sepal_length  sepal_width  petal_length  petal_width    species\n",
       "0_idx             5.1          3.5           1.4          0.2     setosa\n",
       "1_idx             4.9          3.0           1.4          0.2     setosa\n",
       "2_idx             4.7          3.2           1.3          0.2     setosa\n",
       "3_idx             4.6          3.1           1.5          0.2     setosa\n",
       "4_idx             5.0          3.6           1.4          0.2     setosa\n",
       "...               ...          ...           ...          ...        ...\n",
       "145_idx           6.7          3.0           5.2          2.3  virginica\n",
       "146_idx           6.3          2.5           5.0          1.9  virginica\n",
       "147_idx           6.5          3.0           5.2          2.0  virginica\n",
       "148_idx           6.2          3.4           5.4          2.3  virginica\n",
       "149_idx           5.9          3.0           5.1          1.8  virginica\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.rename(lambda x: f'{x}_idx')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "8ca03637-6d0d-432c-aeb2-087f2941283a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     sepal_length  sepal_width  petal_length  petal_width    species\n",
       "0             5.1          3.5           1.4          0.2     setosa\n",
       "1             4.9          3.0           1.4          0.2     setosa\n",
       "2             4.7          3.2           1.3          0.2     setosa\n",
       "3             4.6          3.1           1.5          0.2     setosa\n",
       "4             5.0          3.6           1.4          0.2     setosa\n",
       "..            ...          ...           ...          ...        ...\n",
       "145           6.7          3.0           5.2          2.3  virginica\n",
       "146           6.3          2.5           5.0          1.9  virginica\n",
       "147           6.5          3.0           5.2          2.0  virginica\n",
       "148           6.2          3.4           5.4          2.3  virginica\n",
       "149           5.9          3.0           5.1          1.8  virginica\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df_suffix.rename(columns = lambda x: x.strip('_col'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2e7c3a8b-e9ca-4c0e-9253-e8bc83765d59",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "a9fec668-bc48-4e18-9477-bce1e6e3ab98",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>col_sepal_length</th>\n",
       "      <th>col_sepal_width</th>\n",
       "      <th>col_petal_length</th>\n",
       "      <th>col_petal_width</th>\n",
       "      <th>col_species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   col_sepal_length  col_sepal_width  col_petal_length  col_petal_width  \\\n",
       "0               5.1              3.5               1.4              0.2   \n",
       "1               4.9              3.0               1.4              0.2   \n",
       "2               4.7              3.2               1.3              0.2   \n",
       "3               4.6              3.1               1.5              0.2   \n",
       "4               5.0              3.6               1.4              0.2   \n",
       "\n",
       "  col_species  \n",
       "0      setosa  \n",
       "1      setosa  \n",
       "2      setosa  \n",
       "3      setosa  \n",
       "4      setosa  "
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df_prefix = iris_df.add_prefix('col_').head()\n",
    "iris_df_prefix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "9c4235dd-ce8c-4012-b679-e0fb4bb433d4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sepal_length  sepal_width  petal_length  petal_width species\n",
       "0           5.1          3.5           1.4          0.2  setosa\n",
       "1           4.9          3.0           1.4          0.2  setosa\n",
       "2           4.7          3.2           1.3          0.2  setosa\n",
       "3           4.6          3.1           1.5          0.2  setosa\n",
       "4           5.0          3.6           1.4          0.2  setosa"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df_prefix.rename(columns = lambda x: x.strip('col_'))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d1c88b66-fe72-4844-9026-ccab4b9d8744",
   "metadata": {},
   "source": [
    "### 更改列顺序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "418e5184-5bca-46dc-9f18-79b924cfca7a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'species']"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 当前列顺序\n",
    "iris_df.columns.tolist()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "295f51ea-61a4-41d8-b2b6-81e296c82a30",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['species', 'petal_width', 'petal_length', 'sepal_width', 'sepal_length']"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 顺序调转\n",
    "new_col_order = iris_df.columns.tolist()[::-1]\n",
    "new_col_order"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "e7d147ff-b019-4171-a8dc-a2c9e46a3157",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>species</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>sepal_length</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>setosa</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.5</td>\n",
       "      <td>5.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>setosa</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>4.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>setosa</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>3.2</td>\n",
       "      <td>4.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>setosa</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.5</td>\n",
       "      <td>3.1</td>\n",
       "      <td>4.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>setosa</td>\n",
       "      <td>0.2</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.6</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>virginica</td>\n",
       "      <td>2.3</td>\n",
       "      <td>5.2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>6.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>virginica</td>\n",
       "      <td>1.9</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.5</td>\n",
       "      <td>6.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>virginica</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>6.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>virginica</td>\n",
       "      <td>2.3</td>\n",
       "      <td>5.4</td>\n",
       "      <td>3.4</td>\n",
       "      <td>6.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>virginica</td>\n",
       "      <td>1.8</td>\n",
       "      <td>5.1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       species  petal_width  petal_length  sepal_width  sepal_length\n",
       "0       setosa          0.2           1.4          3.5           5.1\n",
       "1       setosa          0.2           1.4          3.0           4.9\n",
       "2       setosa          0.2           1.3          3.2           4.7\n",
       "3       setosa          0.2           1.5          3.1           4.6\n",
       "4       setosa          0.2           1.4          3.6           5.0\n",
       "..         ...          ...           ...          ...           ...\n",
       "145  virginica          2.3           5.2          3.0           6.7\n",
       "146  virginica          1.9           5.0          2.5           6.3\n",
       "147  virginica          2.0           5.2          3.0           6.5\n",
       "148  virginica          2.3           5.4          3.4           6.2\n",
       "149  virginica          1.8           5.1          3.0           5.9\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df[new_col_order]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "b8fe6a8a-2716-44ac-8721-425b4ef08671",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 自定义顺序\n",
    "new_col_order = ['species',\n",
    "                 'sepal_length', 'petal_length',\n",
    "                 'sepal_width', 'petal_width']\n",
    "iris_df[new_col_order] "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "02d75188-ca0d-4c84-b43b-070c83d69332",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>species</th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_width</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>setosa</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.5</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>setosa</td>\n",
       "      <td>4.9</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>setosa</td>\n",
       "      <td>4.7</td>\n",
       "      <td>1.3</td>\n",
       "      <td>3.2</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>setosa</td>\n",
       "      <td>4.6</td>\n",
       "      <td>1.5</td>\n",
       "      <td>3.1</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>setosa</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.6</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.7</td>\n",
       "      <td>5.2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.5</td>\n",
       "      <td>1.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.5</td>\n",
       "      <td>5.2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.2</td>\n",
       "      <td>5.4</td>\n",
       "      <td>3.4</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>virginica</td>\n",
       "      <td>5.9</td>\n",
       "      <td>5.1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       species  sepal_length  petal_length  sepal_width  petal_width\n",
       "0       setosa           5.1           1.4          3.5          0.2\n",
       "1       setosa           4.9           1.4          3.0          0.2\n",
       "2       setosa           4.7           1.3          3.2          0.2\n",
       "3       setosa           4.6           1.5          3.1          0.2\n",
       "4       setosa           5.0           1.4          3.6          0.2\n",
       "..         ...           ...           ...          ...          ...\n",
       "145  virginica           6.7           5.2          3.0          2.3\n",
       "146  virginica           6.3           5.0          2.5          1.9\n",
       "147  virginica           6.5           5.2          3.0          2.0\n",
       "148  virginica           6.2           5.4          3.4          2.3\n",
       "149  virginica           5.9           5.1          3.0          1.8\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.reindex(columns=new_col_order)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "0ff1d7f9-87d7-4d92-804d-1878fede22c4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>species</th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_width</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>setosa</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.5</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>setosa</td>\n",
       "      <td>4.9</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>setosa</td>\n",
       "      <td>4.7</td>\n",
       "      <td>1.3</td>\n",
       "      <td>3.2</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>setosa</td>\n",
       "      <td>4.6</td>\n",
       "      <td>1.5</td>\n",
       "      <td>3.1</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>setosa</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.6</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.7</td>\n",
       "      <td>5.2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.5</td>\n",
       "      <td>1.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.5</td>\n",
       "      <td>5.2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.2</td>\n",
       "      <td>5.4</td>\n",
       "      <td>3.4</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>virginica</td>\n",
       "      <td>5.9</td>\n",
       "      <td>5.1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       species  sepal_length  petal_length  sepal_width  petal_width\n",
       "0       setosa           5.1           1.4          3.5          0.2\n",
       "1       setosa           4.9           1.4          3.0          0.2\n",
       "2       setosa           4.7           1.3          3.2          0.2\n",
       "3       setosa           4.6           1.5          3.1          0.2\n",
       "4       setosa           5.0           1.4          3.6          0.2\n",
       "..         ...           ...           ...          ...          ...\n",
       "145  virginica           6.7           5.2          3.0          2.3\n",
       "146  virginica           6.3           5.0          2.5          1.9\n",
       "147  virginica           6.5           5.2          3.0          2.0\n",
       "148  virginica           6.2           5.4          3.4          2.3\n",
       "149  virginica           5.9           5.1          3.0          1.8\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.loc[:, new_col_order]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "9ce00bc2-3e7b-4944-bb0e-640700f0d0fb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>species</th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_width</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>setosa</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.5</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>setosa</td>\n",
       "      <td>4.9</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.0</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>setosa</td>\n",
       "      <td>4.7</td>\n",
       "      <td>1.3</td>\n",
       "      <td>3.2</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>setosa</td>\n",
       "      <td>4.6</td>\n",
       "      <td>1.5</td>\n",
       "      <td>3.1</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>setosa</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>3.6</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.7</td>\n",
       "      <td>5.2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>2.5</td>\n",
       "      <td>1.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.5</td>\n",
       "      <td>5.2</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>virginica</td>\n",
       "      <td>6.2</td>\n",
       "      <td>5.4</td>\n",
       "      <td>3.4</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>virginica</td>\n",
       "      <td>5.9</td>\n",
       "      <td>5.1</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       species  sepal_length  petal_length  sepal_width  petal_width\n",
       "0       setosa           5.1           1.4          3.5          0.2\n",
       "1       setosa           4.9           1.4          3.0          0.2\n",
       "2       setosa           4.7           1.3          3.2          0.2\n",
       "3       setosa           4.6           1.5          3.1          0.2\n",
       "4       setosa           5.0           1.4          3.6          0.2\n",
       "..         ...           ...           ...          ...          ...\n",
       "145  virginica           6.7           5.2          3.0          2.3\n",
       "146  virginica           6.3           5.0          2.5          1.9\n",
       "147  virginica           6.5           5.2          3.0          2.0\n",
       "148  virginica           6.2           5.4          3.4          2.3\n",
       "149  virginica           5.9           5.1          3.0          1.8\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.iloc[:, [4,0,2,1,3]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "985206e4-b8c5-4d76-9406-a3ee8a13f33f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>species</th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_width</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     species  sepal_length  petal_length  sepal_width petal_width\n",
       "0        5.1           3.5           1.4          0.2      setosa\n",
       "1        4.9           3.0           1.4          0.2      setosa\n",
       "2        4.7           3.2           1.3          0.2      setosa\n",
       "3        4.6           3.1           1.5          0.2      setosa\n",
       "4        5.0           3.6           1.4          0.2      setosa\n",
       "..       ...           ...           ...          ...         ...\n",
       "145      6.7           3.0           5.2          2.3   virginica\n",
       "146      6.3           2.5           5.0          1.9   virginica\n",
       "147      6.5           3.0           5.2          2.0   virginica\n",
       "148      6.2           3.4           5.4          2.3   virginica\n",
       "149      5.9           3.0           5.1          1.8   virginica\n",
       "\n",
       "[150 rows x 5 columns]"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.set_axis(new_col_order, axis=1) "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bea4d798-79fe-4c6a-af98-2dd0a92fdb9c",
   "metadata": {},
   "source": [
    "### 修改行顺序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "602875b1-c65d-4615-873d-71bd4d412e65",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 取出前5行，并修改行索引\n",
    "iris_df_ = iris_df.iloc[:5,:].rename(lambda x: \n",
    "                                     f'idx_{x}')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "id": "2723bf74-2904-4807-8be9-48361cf61bbf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>idx_4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       sepal_length  sepal_width  petal_length  petal_width species\n",
       "idx_4           5.0          3.6           1.4          0.2  setosa\n",
       "idx_2           4.7          3.2           1.3          0.2  setosa\n",
       "idx_0           5.1          3.5           1.4          0.2  setosa\n",
       "idx_3           4.6          3.1           1.5          0.2  setosa\n",
       "idx_1           4.9          3.0           1.4          0.2  setosa"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_order = ['idx_4','idx_2','idx_0','idx_3','idx_1']\n",
    "iris_df_.reindex(new_order)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "id": "f0aeecd2-d802-4db3-820c-e6fba1cb26df",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>idx_4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       sepal_length  sepal_width  petal_length  petal_width species\n",
       "idx_4           5.0          3.6           1.4          0.2  setosa\n",
       "idx_2           4.7          3.2           1.3          0.2  setosa\n",
       "idx_0           5.1          3.5           1.4          0.2  setosa\n",
       "idx_3           4.6          3.1           1.5          0.2  setosa\n",
       "idx_1           4.9          3.0           1.4          0.2  setosa"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df_.loc[new_order]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "db38997a-6ed7-4b7b-942e-70f986a5cda0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>idx_4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       sepal_length  sepal_width  petal_length  petal_width species\n",
       "idx_4           5.0          3.6           1.4          0.2  setosa\n",
       "idx_2           4.7          3.2           1.3          0.2  setosa\n",
       "idx_0           5.1          3.5           1.4          0.2  setosa\n",
       "idx_3           4.6          3.1           1.5          0.2  setosa\n",
       "idx_1           4.9          3.0           1.4          0.2  setosa"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_order_int = [4, 2, 0, 3, 1]\n",
    "iris_df_.iloc[new_order_int]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "id": "5d5a3a55-bae8-44a6-9738-c63550baa126",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>idx_4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>idx_0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       sepal_length  sepal_width  petal_length  petal_width species\n",
       "idx_4           5.0          3.6           1.4          0.2  setosa\n",
       "idx_3           4.6          3.1           1.5          0.2  setosa\n",
       "idx_2           4.7          3.2           1.3          0.2  setosa\n",
       "idx_1           4.9          3.0           1.4          0.2  setosa\n",
       "idx_0           5.1          3.5           1.4          0.2  setosa"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df_.sort_index(ascending=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b87e9996-75ef-4096-b697-1ad43394cb51",
   "metadata": {},
   "source": [
    "### 删除特定行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "id": "cf122155-3a1d-41f6-bfee-3eaf05e23dda",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>5.4</td>\n",
       "      <td>3.9</td>\n",
       "      <td>1.7</td>\n",
       "      <td>0.4</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.4</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.3</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "      <td>virginica</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>148 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     sepal_length  sepal_width  petal_length  petal_width    species\n",
       "2             4.7          3.2           1.3          0.2     setosa\n",
       "3             4.6          3.1           1.5          0.2     setosa\n",
       "4             5.0          3.6           1.4          0.2     setosa\n",
       "5             5.4          3.9           1.7          0.4     setosa\n",
       "6             4.6          3.4           1.4          0.3     setosa\n",
       "..            ...          ...           ...          ...        ...\n",
       "145           6.7          3.0           5.2          2.3  virginica\n",
       "146           6.3          2.5           5.0          1.9  virginica\n",
       "147           6.5          3.0           5.2          2.0  virginica\n",
       "148           6.2          3.4           5.4          2.3  virginica\n",
       "149           5.9          3.0           5.1          1.8  virginica\n",
       "\n",
       "[148 rows x 5 columns]"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.drop(index=[0,1])\n",
    "# 将inplace参数设置为True，可以在原地修改DataFrame，而不返回一个新的DataFrame"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a1774928-f0f4-4f5f-a019-b49e840b8b0f",
   "metadata": {},
   "source": [
    "### 删除特定列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "id": "d4e85453-a22d-4f1a-9e9f-8dbe2805f8aa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>145</th>\n",
       "      <td>6.7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>146</th>\n",
       "      <td>6.3</td>\n",
       "      <td>2.5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>147</th>\n",
       "      <td>6.5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.2</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>148</th>\n",
       "      <td>6.2</td>\n",
       "      <td>3.4</td>\n",
       "      <td>5.4</td>\n",
       "      <td>2.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>149</th>\n",
       "      <td>5.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>150 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     sepal_length  sepal_width  petal_length  petal_width\n",
       "0             5.1          3.5           1.4          0.2\n",
       "1             4.9          3.0           1.4          0.2\n",
       "2             4.7          3.2           1.3          0.2\n",
       "3             4.6          3.1           1.5          0.2\n",
       "4             5.0          3.6           1.4          0.2\n",
       "..            ...          ...           ...          ...\n",
       "145           6.7          3.0           5.2          2.3\n",
       "146           6.3          2.5           5.0          1.9\n",
       "147           6.5          3.0           5.2          2.0\n",
       "148           6.2          3.4           5.4          2.3\n",
       "149           5.9          3.0           5.1          1.8\n",
       "\n",
       "[150 rows x 4 columns]"
      ]
     },
     "execution_count": 117,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_df.drop(columns='species')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fc18b271-b90c-4154-a55e-d3f74f944b31",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "76c316f7-7463-470d-baf5-d68215efa200",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "46248010-b4e3-4534-afe7-963d6d6afae5",
   "metadata": {},
   "source": [
    "## 视图 vs 副本"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "id": "d5c36f6e-32f2-4304-a6f3-44ef2d325aba",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   A   B\n",
       "0  1  11\n",
       "1  2  22"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'A': [1, 2], 'B': [11, 22]})\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "id": "8cf40a14-e23c-4e9c-9f6d-743c58441ed1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   A\n",
       "0  1\n",
       "1  2"
      ]
     },
     "execution_count": 128,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_view = df[['A']]\n",
    "df_view"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7fdf831a-b89a-4083-a958-09c5b090c6dd",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "e1a20584-6874-47c5-915b-bf19aac7baa9",
   "metadata": {},
   "source": [
    "## 时间序列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "63c023c3-6b9d-47db-9dc7-cd40179f854b",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas_datareader as pdr\n",
    "import datetime\n",
    "\n",
    "start_date = datetime.datetime(2014, 1, 1)\n",
    "end_date   = datetime.datetime(2022, 12, 31)\n",
    "\n",
    "ticker_list = ['SP500']\n",
    "df = pdr.DataReader(ticker_list, \n",
    "                    'fred', \n",
    "                    start_date, \n",
    "                    end_date)\n",
    "df.to_csv('SP500_' + str(start_date.date()) + '_' + str(end_date.date()) + '.csv')\n",
    "df.to_pickle('SP500_' + str(start_date.date()) + '_' + str(end_date.date()) + '.pkl')\n",
    "# pandas.read_csv\n",
    "# pandas.read_pickle"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "67810fc4-5b17-4e3c-8420-38c685752f98",
   "metadata": {},
   "source": [
    "## 导入、导出文件"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0c1884bd-53ed-4a8e-9dca-cfee0cdc7086",
   "metadata": {},
   "source": [
    "### 导出数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "7253dfa7-bf19-4c16-a204-3b9fdcc3b5bd",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将数据帧存成CSV文件\n",
    "csv_filename = 'iris_df.csv'\n",
    "iris_df.to_csv(csv_filename, \n",
    "               index = False)\n",
    "# 目前JupyterLab默认支持直接查看CSV数据，不需要任何插件\n",
    "# 参考:\n",
    "# https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "7a799876-b059-42dd-a50d-a25aa71fafd9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将数据帧存成Excel文件\n",
    "xlsx_filename = 'iris_df.xlsx'\n",
    "iris_df.to_excel(xlsx_filename,\n",
    "                 sheet_name='iris_data')  \n",
    "#参考：\n",
    "# https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_excel.html\n",
    "# 数据帧还可以存成SQL、JSON、pickle等等格式"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6c06033d-9638-4bf3-a021-a0d242ac1370",
   "metadata": {},
   "source": [
    "### 导入文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "73c32112-ee12-4b6d-bf73-5ac8ce612960",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 将导出的CSV、Excel文件再次读入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "5aaa1e0e-63de-4370-904c-50447abe4926",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   sepal_length  sepal_width  petal_length  petal_width species\n",
       "0           5.1          3.5           1.4          0.2  setosa\n",
       "1           4.9          3.0           1.4          0.2  setosa\n",
       "2           4.7          3.2           1.3          0.2  setosa\n",
       "3           4.6          3.1           1.5          0.2  setosa\n",
       "4           5.0          3.6           1.4          0.2  setosa"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读入CSV文件\n",
    "iris_df_from_CSV = pd.read_csv(csv_filename)\n",
    "# 参考：\n",
    "# https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html\n",
    "\n",
    "iris_df_from_CSV.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "379c27fa-2f96-4f2f-aff1-a51db6649244",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>sepal_length</th>\n",
       "      <th>sepal_width</th>\n",
       "      <th>petal_length</th>\n",
       "      <th>petal_width</th>\n",
       "      <th>species</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>5.1</td>\n",
       "      <td>3.5</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>4.9</td>\n",
       "      <td>3.0</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>4.7</td>\n",
       "      <td>3.2</td>\n",
       "      <td>1.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>4.6</td>\n",
       "      <td>3.1</td>\n",
       "      <td>1.5</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.6</td>\n",
       "      <td>1.4</td>\n",
       "      <td>0.2</td>\n",
       "      <td>setosa</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Unnamed: 0  sepal_length  sepal_width  petal_length  petal_width species\n",
       "0           0           5.1          3.5           1.4          0.2  setosa\n",
       "1           1           4.9          3.0           1.4          0.2  setosa\n",
       "2           2           4.7          3.2           1.3          0.2  setosa\n",
       "3           3           4.6          3.1           1.5          0.2  setosa\n",
       "4           4           5.0          3.6           1.4          0.2  setosa"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 读入Excel文件\n",
    "iris_df_from_Excel = pd.read_excel(xlsx_filename)\n",
    "# 参考：\n",
    "# https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html\n",
    "\n",
    "iris_df_from_Excel.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2a76d332-aee9-4e69-b1d7-20b5eac340a5",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Repo: https://github.com/Visualize-ML\n",
    "# Book 1 Python for Beginners  |  From Basic Arithmetic to Machine Learning\n",
    "# Published and copyrighted by Tsinghua University Press\n",
    "# Beijing, China, 2023"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
